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
Should I use vce(robust) for my OLS regression?Hi everyone, this is my first time posting, so I hope that I include all the relevant information. I…
Structural equation modeling: Whether and how to estimate margins w.r.t. a latent variableI’d like to get input from the Stata community on the advisability and potential utility of estimati…
Estimating Risk Ratios from Survival DataHi all, Does anyone have any experience calculating risk ratios from survival data generated sts li…
How does the option"ties" work in psmatch2?Hello: It says in the user's manual : ties not only match nearest neighbor but also other controls w…
Share of working hours by a segment of race comparing to the total raceHello everyone, I'm working with basic monthly sample of CPS and I'd like to calculate for each occ…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a rate grouped by another variable
Post a Comment