BookmarkSubscribeRSS Feed
Quartz | Level 8

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;


Putting 'province' as CLASS doesn't appear to do anything.


How can I get grand total?

Super User

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. 

Quartz | Level 8

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

Quartz | Level 8

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 ;


Also note this data is not actual counts of anything (just a made up dataset to try and get the syntax working).



Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


Register now!

What is ANOVA?

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.

Discussion stats
  • 3 replies
  • 2 in conversation