BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
UcheOkoro
Lapis Lazuli | Level 10

Hello,

 

Please, I need help pooling the difference in median with 95% from proc quantreg across 5 imputation using proc MI analyze.

From the log it appears that  I need the standard error for the median to do so.

Please, I need help getting that .

Thank you.

 

/******Diff. in Median for matched 28-hospital free days ****/
proc quantreg data=  Avera_matched_data;
   class telemed_use;
   model Hospital_free_days4 = telemed_use / quantile=0.5;
   estimate 'Diff in Medians' telemed_use 1 -1 / CL;
   ODS OUTPUT PARAMETERESTIMATES=diff_in_median ;
   by _Imputation_;
run;
PROC MIANALYZE PARMS(CLASSVAR=LEVEL)=diff_in_median;
 CLASS telemed_use;
 MODELEFFECTS telemed_use;
 ODS OUTPUT PARAMETERESTIMATES=diff_in_median2;
RUN;
1 ACCEPTED SOLUTION

Accepted Solutions
SAS_Rob
SAS Employee

Can you post the LOG as well?  In general, the approach you took should work, similar to this example:


data Fitness1;
input Oxygen RunTime RunPulse @@;
RT_Class=(runtime > 10.5);
datalines;
44.609 11.37 178 45.313 10.07 185
54.297 8.65 156 59.571 . .
49.874 9.22 . 44.811 11.63 176
. 11.95 176 . 10.85 .
39.442 13.08 174 60.055 8.63 170
50.541 . . 37.388 14.03 186
44.754 11.12 176 47.273 . .
51.855 10.33 166 49.156 8.95 180
40.836 10.95 168 46.672 10.00 .
46.774 10.25 . 50.388 10.08 168
39.407 12.63 174 46.080 11.17 156
45.441 9.63 164 . 8.92 .
45.118 11.08 . 39.203 12.88 168
45.790 10.47 186 50.545 9.93 148
48.673 9.40 186 47.920 11.50 170
47.467 10.50 170
;


/******/
/* MI */
/******/
proc mi data=Fitness1 seed=3237851 noprint out=outmi;
class RT_CLASS;
var Oxygen RT_Class RunPulse;
FCS;
run;


proc quantreg data=outmi CI=resampling;
by _Imputation_;
class RT_Class;
fitness: model Oxygen= RT_Class RunPulse / quantile=0.5;
ods output ParameterEstimates=PE;
run;

proc print;
run;

proc mianalyze parms(classvar=level)=PE
edf=28;
class RT_Class;
modeleffects Intercept RT_Class RunPulse;
run;

View solution in original post

7 REPLIES 7
SAS_Rob
SAS Employee

Can you post the LOG as well?  In general, the approach you took should work, similar to this example:


data Fitness1;
input Oxygen RunTime RunPulse @@;
RT_Class=(runtime > 10.5);
datalines;
44.609 11.37 178 45.313 10.07 185
54.297 8.65 156 59.571 . .
49.874 9.22 . 44.811 11.63 176
. 11.95 176 . 10.85 .
39.442 13.08 174 60.055 8.63 170
50.541 . . 37.388 14.03 186
44.754 11.12 176 47.273 . .
51.855 10.33 166 49.156 8.95 180
40.836 10.95 168 46.672 10.00 .
46.774 10.25 . 50.388 10.08 168
39.407 12.63 174 46.080 11.17 156
45.441 9.63 164 . 8.92 .
45.118 11.08 . 39.203 12.88 168
45.790 10.47 186 50.545 9.93 148
48.673 9.40 186 47.920 11.50 170
47.467 10.50 170
;


/******/
/* MI */
/******/
proc mi data=Fitness1 seed=3237851 noprint out=outmi;
class RT_CLASS;
var Oxygen RT_Class RunPulse;
FCS;
run;


proc quantreg data=outmi CI=resampling;
by _Imputation_;
class RT_Class;
fitness: model Oxygen= RT_Class RunPulse / quantile=0.5;
ods output ParameterEstimates=PE;
run;

proc print;
run;

proc mianalyze parms(classvar=level)=PE
edf=28;
class RT_Class;
modeleffects Intercept RT_Class RunPulse;
run;

UcheOkoro
Lapis Lazuli | Level 10

The log is as follows:

UcheOkoro_0-1648482905759.png

 

SAS_Rob
SAS Employee

You'll notice in the output from QUANTREG itself that there is not a standard error in the ParameterEstimates table.  That is because the default confidence limits are computed with the inverse-rankscore method without computing a standard error. You need to specify the option CI=RESAMPLING or CI=SPARSITY in the PROC statement (see my example) to get standard errors.

UcheOkoro
Lapis Lazuli | Level 10

Please, how did you arrive at an EDF of 28?

UcheOkoro
Lapis Lazuli | Level 10

Never mind. I got it!. Thank you again!

UcheOkoro
Lapis Lazuli | Level 10

Thank you so much for your timely assistance. I am most grateful!

SAS Innovate 2025: Call for 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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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