BookmarkSubscribeRSS Feed
fieldsa83
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;
run;

 

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

 

How can I get grand total?

3 REPLIES 3
Reeza
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. 

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

fieldsa83
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 ;
run;

 

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


Capture.JPG

sas-innovate-2024.png

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
  • 1563 views
  • 0 likes
  • 2 in conversation