Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Re: Percentiles from proc surveymeans differ slightly from proc means

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 12-18-2018 12:15 PM
(2182 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Are you ready for the spotlight? We're accepting content ideas for **SAS Innovate 2025** to be held May 6-9 in Orlando, FL. The call is **open **until September 16. Read more here about **why** you should contribute and **what is in it** for you!

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.