Programming the statistical procedures from SAS

PROC SURVEYMEANS not showing grand totals

Reply
Contributor
Posts: 74

PROC SURVEYMEANS not showing grand totals

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?

Grand Advisor
Posts: 16,893

Re: PROC SURVEYMEANS not showing grand totals

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. 

Contributor
Posts: 74

Re: PROC SURVEYMEANS not showing grand totals

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

Contributor
Posts: 74

Re: PROC SURVEYMEANS not showing grand totals

[ Edited ]

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

Attachment
Ask a Question
Discussion stats
  • 3 replies
  • 65 views
  • 0 likes
  • 2 in conversation