5.1 Estimation of frequencies

The variable \(\texttt{ENV_AFRDWLK_MCQ}\) represents the CLSA survey question: “People would be afraid to walk alone after dark in this area.” If we want to estimate the total number of people in the study population who agree or disagree about the statement, we can use the following sets of codes to create tables of frequencies with standard errors.

R

svytotal(  ~(ENV_AFRDWLK_MCQ1), design= CLSA.design)

SAS

PROC SURVEYFREQ  data= CLSAData ;        
  TABLE  ENV_AFRDWLK_MCQ1;                                           
  strata GEOSTRAT_TRM ; 
  weight WGHTS_INFLATION_TRM;                                      
RUN; 

SPSS

Click “Analyze” \(\rightarrow\) “Complex Samples” \(\rightarrow\) “Frequency…” \(\rightarrow\) Browse and select the \(\texttt{CLSADesign.csaplan}\) created. \(\rightarrow\) Click “\(\texttt{Next}\)” and import a variable (\(\texttt{ENV_AFRDWLK_MCQ}\)) \(\rightarrow\) Click “\(\texttt{Statistics...}\)\(\rightarrow\) select “Population size” and “Standard error” \(\rightarrow\) Click “Continue” \(\rightarrow\) Click “OK”.

Stata

 svy linearized : tabulate ENV_AFRDWLK_MCQ, count se ci  stubwidth(20) format(%10.0g)
Result comparison
R
SAS
SPSS
Stata
Population Est. Total SE Total SE Total SE Total SE
Strongly Agree 52666 7452 52666 7452 52666 7452 52666 7452
Agree 65819 8502 65819 8502 65819 8502 65819 8502
Disagree 149611 13811 149611 13811 149611 13811 149611 13811
Strongly Disagree 281096 21512 281096 21512 281096 21512 281096 21512

Note: The total of the population estimates from the table above is much smaller that the CLSA study population. It is because the dataset used for illustration is only a subset of the CLSA dataset. The actual dataset should give much larger population totals.