Hi,
I'm using proc freq to generate tables out of my surveydata. I'm using surveyweights in the weight statement (to correct survey nonresponse). For academic purposes, I would like to combine weighted percentages with unweighted frequencies in my SAS output.
Is this possible in SAS 9.4.? How?
Example:
proc freq data=work.inkomen1;
tables gf*v82 gesl*gf*v82 lftk*gf*v82/nocol nopercent chisq;
title 'Bent u of iemand anders van uw gezin eigenaar van deze woning? ABSOLUTE AANTALLEN';
weight weeg2;
run;
Thank you!
Veerle
If you use Proc Surveyfreq it will give Frequency and Unweighted frequencies.
Plus if your survey has any type of complex design this would be the appropriate procedure if the proper sample design information is provided.
Thank you!
I'm familiar with proc surveyfreq (no need for that in this particular issue as I have a simple sample design). But proc surveyfreq output gives me these really annoying flat tables.
I usually model my output (with ODS and proc template) to get the exact tables I want from proc freq, and export these to excel. This way I can quickly generate charts ... and there is no need of typing everything in word, just copy/paste ...
I can do this for proc freq output, but not for proc surveyfreq output since it gives me these flat tables.
If someone has tips how to get nice 2*2 tables out of proc surveyfreq, that would help too and I would be happy. 😄
I tend to direct output from Surveyfreq to data sets and then print or use other report proc, possibly after manipulation.
Other wise, use proc freq twice, output the results to data sets (use the noprint option if you don't want to see these) combine the data renaming the Count (and percent if desired) variables in one when merging/joining with the other data set on the values of your table variables
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.