7.1 Estimation of domain proportions
If we are interested in understanding how people comment on the sentence, “People would be afraid to walk alone after dark in this area” (\(\texttt{ENV_AFRDWLK_MCQ}\)) among the groups of people with or without a university degree, we may use the following codes.
R
SAS
PROC SURVEYMEANS data = CLSAData mean;
VAR ENV_AFRDWLK_MCQ;
DOMAIN ED_HIGH_TRM;
STRATA GEOSTRAT_TRM;
WEIGHT WGHTS_INFLATION_TRM;
RUN;
SPSS
Analyze \(\rightarrow\) Complex Samples \(\rightarrow\) Frequencies… \(\rightarrow\) Select the file “\(\texttt{CLSADesign.csaplan}\)” in the Plan panel \(\rightarrow\) select \(\texttt{ENV_AFRDWLK_MCQ}\) to the Frequency Table panel \(\rightarrow\) select \(\texttt{ED_HIGH_TRM}\) to the “Subpopulations:” panel \(\rightarrow\) click “Statistics…” \(\rightarrow\) select “Table percent” and “Standard error” \(\rightarrow\) click “Continue”\(\rightarrow\) click “OK”.
Stata
*We first change the survey design to that with inflation survey weight
svyset entity_id, strata(StraVar) weight(WGHTS_INFLATION_TRM)
vce(linearized) singleunit(certainty)
* For people who never attained any university
svy linearized, subpop(if ED_HIGH_TRM == "Non_university") : tabulate
ENV_AFRDWLK_MCQ , cell se ci stubwidth(20) format(%10.0g)
* For people who have attained an university
svy linearized, subpop(if ED_HIGH_TRM == "University") : tabulate
ENV_AFRDWLK_MCQ , cell se ci stubwidth(20) format (%10.0g)
Result comparison
Population Estimates | Mean | SE | Mean | SE | Mean | SE | Mean | SE |
---|---|---|---|---|---|---|---|---|
Non university | ||||||||
Strongly Agree | 0.0857 | 0.0141 | 0.0857 | 0.0141 | 0.0857 | 0.0141 | 0.0857 | 0.0141 |
Agree | 0.1080 | 0.0177 | 0.1080 | 0.0177 | 0.1080 | 0.0177 | 0.1080 | 0.0177 |
Disagree | 0.2548 | 0.0312 | 0.2548 | 0.0312 | 0.2548 | 0.0312 | 0.2548 | 0.0312 |
Strongly Disagree | 0.5515 | 0.0357 | 0.5515 | 0.0357 | 0.5515 | 0.0357 | 0.5515 | 0.0357 |
University | ||||||||
Strongly Agree | 0.1122 | 0.0275 | 0.1122 | 0.0275 | 0.1122 | 0.0275 | 0.1122 | 0.0275 |
Agree | 0.1388 | 0.0287 | 0.1388 | 0.0287 | 0.1388 | 0.0287 | 0.1388 | 0.0287 |
Disagree | 0.3006 | 0.0392 | 0.3006 | 0.0392 | 0.3006 | 0.0392 | 0.3006 | 0.0392 |
Strongly Disagree | 0.4484 | 0.0448 | 0.4484 | 0.0448 | 0.4484 | 0.0448 | 0.4484 | 0.0448 |