Hello,
I have a large dataset (27 vars, 1,048,575 obs) that contains data on malaria insecticide treated nets (ITNs) distributed at antenatal care (ANC) visits per facility over a 3 year period (2019-2021). I am looking to create a new variable of “ANC Issuing Rate” that includes the numerator [sum of ITNs distributed between 2019-2021] divided by the denominator [sum ANC registrants in 2019-2021] grouped per facility. Overall, I am looking to get one issuing rate per facility for the total time period.
I have tried to use this code below. It is creating a rate for each row (ie a rate for each month) but it is not grouping this rate by facility and by the 3 years. I have included a reduced dataset and how I wish the final data to appear. I very much appreciate any and all guidance on this topic!
bysort facility: gen anc_grouped= ITN_Distributed/ ANC_Registrants
(This is my first time here so I also appreciate feedback on posting etiquette for future posts)
Related Posts with Creating a rate grouped by another variable
add group axis label to chartHi there In chart options, is there a way to add a second group axis label? Example below (year and…
Space between axis and line chartHi, I have dataset starting in Febuary 2020 but when I create a chart for some reason the x axis sta…
Single and Quadratic function in one loopDear Experts, I need you advice on the possibility to loop 2 codes into one. One is quadratic funct…
Using cii proportions with loopHello, I am trying to compute confidence intervals for proportions (number of cases / total) on eac…
LSDV and collinearityHi everyone, I am having trouble implementing a simple least square dummy variable (LSDV) model. The…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a rate grouped by another variable
Post a Comment