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
Replace missing values in group dataHi everyone, Was looking for a solution to the following problem. I have a panel data that has som…
Displaying in results names of temporary variablesI suspect I've missed an obvious solution, but is there a way to display the assigned name of a temp…
How to load HUGE file that exceeds physical memory - Max_Memory not working.I am using Stata 16.1 on Windows server 2012 with 256GB of memory. Trying to import 400GB MySQL data…
Three way interactionHello, Does anyone know how to interpret the two way interactions when a three way interaction is in…
"Predicts failure perfectly" (Probit, logit with interaction terms)Dear Statalist, I am trying to run probit and logit models, but when I include interaction terms I …
Subscribe to:
Post Comments (Atom)
0 Response to Creating a rate grouped by another variable
Post a Comment