BookmarkSubscribeRSS Feed
Maria01
Calcite | Level 5

I am somewhat new to survey analysis. I am running a code for survey sample and want to report the standard deviation, I am getting this big numbers in comparison to an unweighted code, I am pretty sure is something easy I am not looking at,can anyone help?

 

proc means data=ms19.ms19 MEAN STD STDERR ALPHA=0.05 CLM;;
VAR AGE;
RUN ;

SAS Output

Analysis Variable : AGE Age Mean Std Dev Std Error Lower 95%
CL for Mean Upper 95%
CL for Mean
45.847517513.93182440.108739645.634376246.0606588

 

 proc surveymeans data=ms19.ms19 MEAN RMSSTD STDERR ALPHA=0.05 CLM;
strata strat; cluster PSU_ID; weight WEIGHT_PA_IPW_OVERALL;
var AGE;
run;

SAS Output

SAS Output

Data Summary Number of Strata Number of Clusters Number of Observations Sum of Weights
20
664
16415
23413.2548

Statistics Variable Label Mean Std Error of Mean 95% CL for Mean Std Dev AGE
Age39.8673820.36988939.141046740.593716740229
 

 

 
3 REPLIES 3
art297
Opal | Level 21

My initial guess is that you have one or more AGEs that is impossibly high and also has a very high value in the variable you are using to weight the analysis.

 

Art, CEO, AnalystFinder.com

 

Maria01
Calcite | Level 5

Hi Art297, 

thank you for your help, I have read up on it and it seems I have a code the is not appropriate. The age range I have is from 45 to 75 years old and have no outliers, and my weight is to adjust for age as well. 

it seems the code I need is someting similar to this:

proc means data=xxx n MIN MAX MEAN STD STDERR ALPHA=0.05 CLM;
weight xxx;
BY xxx;
var AGE;
run;

SAS Output

Analysis Variable : AGE Age N Minimum Maximum Mean Std Dev Std Error Lower 95%
CL for Mean Upper 95%
CL for Mean
7675457556.506.630.0956.3156.68
see the results seem something more realistic.
Thank you. 
lopezr
Obsidian | Level 7

PROC SURVEYMEANS does not directly compute the standard deviation for the mean, the reported st. dev. is for the SUM. 

You might find this SAS Note useful: http://support.sas.com/kb/45/701.html.

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2250 views
  • 0 likes
  • 3 in conversation