I've been trying a few things, but I can't replicate what I do in regular proc means to produce the grand totals.
This code only outputs the statistics for each prov (but NOT the grand total of all provs--which I also need).
proc surveymeans data=import1 clm nobs mean median CV SUMWGT varmethod=brr ;
var hrlyearn ;
by province ;
repweights bw1-bw1000;
ods output statistics=out;
weight finalwt;
run;
Putting 'province' as CLASS doesn't appear to do anything.
How can I get grand total?
If you have neither a CLASS or BY statement wouldn't that be for all PROV?
You may need to include it in the STRATA or CLUSTEr statement but I don't know the specifics of the experimental design.
If you're using a StatCan product the documentation usually has examples on how to write SAS code correctly.
DOMAIN seems to be doing it (can also cross two subgroups). Still not giving me the grand total though.
I need something like ALL in proc tabulate..
I attached a photo of the output from this, using DOMAIN. But I still can't get the grand totals for each group.
proc surveymeans data=import1 clm nobs mean median CV SUMWGT varmethod=brr ;
var hrlyearn ;
domain prov*sex;
cluster prov;
repweights bw1-bw10;
ods output statistics=means Domain=domain ;
run;
Also note this data is not actual counts of anything (just a made up dataset to try and get the syntax working).
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.