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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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