Hi,
I am working with panel data where I have 9 different regions and in each region there are a different number of schools. The time period is 10 months. What I am trying to do is to collapse the variable sick-absence in percentage among the teachers in each school for each region and period, I therefor collapse by region and time. The weight that I want to use is the number of pupils at each school, making schools that have a larger number of students have more weights compared to the smaller once. My problem is that I don't understand if stata takes into account that I am collapsing by region and time period, is the weighting done by the number of pupils in each region and period or the pupils in all regions and all periods? The second problem that I have is that I want to have the number of pupils for each region and period but without any weight, is there any good solution for that?
My code so far:
collapse sick_absence [fweight=number_of_students], by(city timeperiod)
Related Posts with Collapse by several variables
Running Stata on Raspberry Pi 4B (a guide)I know this is more of a ‘geek’ idea but in case you can’t always take your laptop with you (like me…
* Tests of endogeneityDear all, I will please like to know which result is usually reported for test of endogeneity after…
Time-Invariant instrument variable and country fixed effects in pooled cross-sectional datasetI have following question; Can I use time-invariant instrumental variable while controlling for coun…
Break , Exit or clear nothing is working on stata 17 maybe because of a complex codingCould anyone help me to find a solution if none of - break , exit or clear doesn't work on stata 17 …
Patient Flow FrequenciesHi Everyone, I am working with a datset that has following variables: 1) mrn: unique identifier 2)…
Subscribe to:
Post Comments (Atom)
0 Response to Collapse by several variables
Post a Comment