I have survey data that I want to analyze in STATA using svy but when I try to specify the svyset I get an error message saying that fpc must be the same within each stratum. I'm not sure what the problem is. This is the survey design:
1) First stage: sampled 8 districts within each region. There are 3 regions total
2) Second stage: 10 schools were sampled within each district stratifying by rural and urban. Schools were selected from 2 different frames, one frame with a list of urban schools and the other with a list of rural schools
3) Third stage: 13 students were sampled within each school for each of the 3 grades: 2, 4 and 6.
This is the list of IDs used in the svyset:
region_id: unique id for each of the regions (1-3)
district_id: unique id for each of the districts sampled (1-8)
urban: id to identify whether a school is rural or urban (U or R)
school_id: unique id for each of the 80 schools (10 schools in 8 districts)
grade: id to identify grades 2,4,6
id: unique id for each child in the sample
These are my fpcs:
ndistricts: this is the number of eligible districts in each region (e.g. 23, 25 and 28).
nschools: this is the number of schools in each district by urban/rural. (e.g. nschools=40 for district #1/urban and nschools=60 for district#1/rural). There are 2 different fpc numbers for each district, one for rural and one for urban.
nstud_bygrade: this is the number of students per grade for each school.There are 3 numbers for each schools sampled.
This is the svyset
svyset district_id [pw=wt_final], strata(region_id) fpc(ndistricts) || school_id, strata(urban) fpc(nschools) || id, strata(grade) fpc(nstud_bygrade) singleunit(centered)
I have read the manual but I don't know what the problem is. Are my fpcs or the strata ids? Should instead of being the urban variable (U/R), should it be districtxrural/urban?
I wish you could help me and give me some guidance. I really appreciate your time for reading this e-mail.
Thanks,
Jenny
1) First stage: sampled 8 districts within each region. There are 3 regions total
2) Second stage: 10 schools were sampled within each district stratifying by rural and urban. Schools were selected from 2 different frames, one frame with a list of urban schools and the other with a list of rural schools
3) Third stage: 13 students were sampled within each school for each of the 3 grades: 2, 4 and 6.
This is the list of IDs used in the svyset:
region_id: unique id for each of the regions (1-3)
district_id: unique id for each of the districts sampled (1-8)
urban: id to identify whether a school is rural or urban (U or R)
school_id: unique id for each of the 80 schools (10 schools in 8 districts)
grade: id to identify grades 2,4,6
id: unique id for each child in the sample
These are my fpcs:
ndistricts: this is the number of eligible districts in each region (e.g. 23, 25 and 28).
nschools: this is the number of schools in each district by urban/rural. (e.g. nschools=40 for district #1/urban and nschools=60 for district#1/rural). There are 2 different fpc numbers for each district, one for rural and one for urban.
nstud_bygrade: this is the number of students per grade for each school.There are 3 numbers for each schools sampled.
This is the svyset
svyset district_id [pw=wt_final], strata(region_id) fpc(ndistricts) || school_id, strata(urban) fpc(nschools) || id, strata(grade) fpc(nstud_bygrade) singleunit(centered)
I have read the manual but I don't know what the problem is. Are my fpcs or the strata ids? Should instead of being the urban variable (U/R), should it be districtxrural/urban?
I wish you could help me and give me some guidance. I really appreciate your time for reading this e-mail.
Thanks,
Jenny
Comment