BookmarkSubscribeRSS Feed
Franziska
Calcite | Level 5

Hello, 

 

is it possible to calculate confidence limits for the median with weighted data? 

 

With proc univariate, I can calculate confidence limits for the median but those are not produced when the weight statement is used. 

 

Thanks for helping in advance 

1 REPLY 1
Rick_SAS
SAS Super FREQ

The documentation for PROC UNIVARIATE says: "Note that confidence limits for percentiles are not computed when a WEIGHT statement is specified."

 

However, recall that you can use regression procedures to carry out univariate analyses. Click on the link and scroll down to the third bullet to see how to use PROC QUANTREG to estimate quantiles and include confidence intervals. The QUANTREG procedure supports a WEIGHT statement.  For example:

 

ods output ParameterEstimates=QntlCI;
proc quantreg data=sashelp.cars;
   model MPG_City= / quantiles=0.5;
   weight weight;
run;
 
proc print data=QntlCI; run;

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
  • 1 reply
  • 1429 views
  • 1 like
  • 2 in conversation