Hello,
Using the code below does not generate weighted estimates. Is there a different way to get the expected results?
proc tabulate data = parents vardef=weight;
weight pwpwgt;
class parseg;
table parseg =' ' all,
n*f=7.0 pctn*f=9.1 /rts=25;
keylabel pctn = 'Percent'
all = 'Total';
format parseg prselfm.;
title 'Weighted Estimates Using vardef=weight in Proc Tabulate';
run;
Reference for vardef=weight:
https://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473731.htm#a000068934
Thanks,
Artp
@Artp wrote:
Thank you Grand Advisor for your feedback. This is the first time I am learning Proc Tabulate to analyze a huge survey data set. Can you please be more explicit?
Regards,
Artp
Is your survey sample from a simple random sample? If not such as a stratified sample, a cluster sample or almost any other sample type you may need to be looking into the Survey procs such as Surveymeans SurveyFreq SurveyLogistic and SurveyReg for analysis.
I would likely only use tabulate for the raw data to get a feel for sample counts, which your code did, and check skip patterns or recoding of variables.
Or display of values summarized from the survey procs.
Tabulate N statistic reports just than, the number of values not the weighted n. You may want to consider adding a dummy variable with the value of 1 for each record, use that as a Var variable and request the sum and pctsum of that variable.
Thank you Grand Advisor for your feedback. This is the first time I am learning Proc Tabulate to analyze a huge survey data set. Can you please be more explicit?
Regards,
Artp
@Artp wrote:
Thank you Grand Advisor for your feedback. This is the first time I am learning Proc Tabulate to analyze a huge survey data set. Can you please be more explicit?
Regards,
Artp
Is your survey sample from a simple random sample? If not such as a stratified sample, a cluster sample or almost any other sample type you may need to be looking into the Survey procs such as Surveymeans SurveyFreq SurveyLogistic and SurveyReg for analysis.
I would likely only use tabulate for the raw data to get a feel for sample counts, which your code did, and check skip patterns or recoding of variables.
Or display of values summarized from the survey procs.
Hello ballardw,
Your contribution is uplifting! I don't like going on weekends with unsolved mysteries. My problem was how to present the outputs from survey procedures (Surveyfreq and Surveymeans) - weighted freqs/estimates - in refined tables like those from Proc Tabulate or Report.
Archer R. Gravely's book "Your Guide To Survey Research Using the SAS System" does an excellent job presenting survey data tables/reports.
Have a great weekend,
Artp
Did you try option of VAR statement.
proc tabulate data=sashelp.class;
class sex;
var height/weight=age;
table sex,height*mean;
run;
Hi Ksharp,
SAS did not like the inclusion of "/weight=age" ; log said, "unknown variable."
Thank you,
Artp
@Artp wrote:
Hi Ksharp,
SAS did not like the inclusion of "/weight=age" ; log said, "unknown variable."
Thank you,
Artp
The variable name after Weight= should be YOUR weight variable. Age was an example for the SASHELP.CLASS data set.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.