BookmarkSubscribeRSS Feed
johnsonemilyk
Fluorite | Level 6

I want to get the standard error of the weighted frequency from PROC SURVEYFREQ but am only seeing the standard deviations by default. Below is sample code I'm using. How would I get this to pull SE? I'm using SAS 9.4.

 


PROC SURVEYFREQ DATA=mydata;
TABLES state*gender / ROW;
WHERE year=2013 AND state IN (14,15,16,20,3,21);
WEIGHT mywgt;
RUN;

3 REPLIES 3
ballardw
Super User

You may either be misreading the column headings or your data has something odd going on. I don't have your data but when I run this:

proc surveyfreq data=sashelp.class;
   tables  sex*age /row; 
   weight  height;
run;

the output includes a column for Weighted Frequency and "Std Err of Wgt Freq", which is what you are requesting. It also has Std Err of Percent and Std Err of Row Percent. If you added a COLUMN option you would get a Std Err of Col Percent as well.

johnsonemilyk
Fluorite | Level 6

Thank you so much for responding! I'm not sure what's happening, but when I run the same code on the "class" data set, I still get the same headers (see attached image) - so it provides the standard errors for percents and row percents, but only the SD for the actual frequency. Any ideas what might be going on here?

Watts
SAS Employee

This column heading was "Std Dev" in older releases. 

 

It was changed (from "Std Dev" to "Std Err") in PROC SURVEYMEANS and PROC SURVEYFREQ in release 14.1. The (former) "Std Dev" was referring to the standard error of the sum (not the estimated population standard deviation). Changed to clarify this.   

 

There's some information in

Usage Note 5921: A discussion of standard errors and standard deviations in the SURVEYMEANS procedure

http://support.sas.com/kb/59/251.html

 

Only the column heading changed; the computation is the same.

Documentation is here (SURVEYFREQ):

https://go.documentation.sas.com/?docsetId=statug&docsetTarget=statug_surveyfreq_details36.htm&docse...

and here (SURVEYMEANS):

https://go.documentation.sas.com/?docsetId=statug&docsetTarget=statug_surveymeans_details06.htm&docs...

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2245 views
  • 0 likes
  • 3 in conversation