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...

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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