SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Monicapn
Calcite | Level 5

Hi,

 

I am getting slightly different values for percentiles of a continuous variable when I use proc surveymeans vs. proc means. I meant to calculate crude geometric means for my variable (Serum_conc) and also get percentiles of its distribution, so I did not enter any sampling weights, stratum, cluster or finite population correction into proc surveymeans. The reason to use proc surveymeans is to  calculate survey-method adjusted GMs and compare them to the crude estimates, so I started with the crude GM calculations and also included percentiles. I expected proc surveymeans to calculate identical percentiles for the same variable as proc means, but the values differ slightly in the decimals -- do the two procedures use different default calculations for percentiles? My code is below.

 

PROC MEANS DATA=datafile n nmiss min p25 p50 p75 p90 p95 max;
var Serum_conc;
RUN;

 

PROC SURVEYMEANS DATA=datafile GEOMEAN GMCLM NMISS percentile=(25,50,75,90,95) max;
VAR Serum_conc;
ODS OUTPUT Statistics=dataset1 GeometricMeans=dataset2; *Specify ODS table names as output datasets;
RUN;
*Print temporary datasets/tables;
PROC PRINT data=dataset1;
RUN;
PROC PRINT data=dataset2;
RUN;

 

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

The documentation for Surveymeans includes:

 

PROC SURVEYMEANS uses Woodruff’s method (Dorfman and Valliant 1993; Särndal, Swensson, and Wretman 1992; Francisco and Fuller 1991) to estimate the variances of quantiles. For more details, see the section Quantiles.

 

 

So I suspect that percentiles are calculated somewhat differently to account for the additional things Surveymeans has to address.

View solution in original post

2 REPLIES 2
ballardw
Super User

The documentation for Surveymeans includes:

 

PROC SURVEYMEANS uses Woodruff’s method (Dorfman and Valliant 1993; Särndal, Swensson, and Wretman 1992; Francisco and Fuller 1991) to estimate the variances of quantiles. For more details, see the section Quantiles.

 

 

So I suspect that percentiles are calculated somewhat differently to account for the additional things Surveymeans has to address.

Monicapn
Calcite | Level 5

Thank you. I had found that in the SAS documentation for each procedure -- the formula from proc means is pretty straight forward and the formula from proc surveymeans uses probability. We decided to go ahead and use the proc surveymeans procedure for the percentiles, since we are using it to estimate the geometric means, for consistency.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2622 views
  • 2 likes
  • 2 in conversation