Programming the statistical procedures from SAS

confidence limits for median with weighted data

Reply
Occasional Learner
Posts: 1

confidence limits for median with weighted data

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 

SAS Super FREQ
Posts: 3,307

Re: confidence limits for median with weighted data

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;
Ask a Question
Discussion stats
  • 1 reply
  • 59 views
  • 1 like
  • 2 in conversation