BookmarkSubscribeRSS Feed
UcheOkoro
Lapis Lazuli | Level 10

Hello,

 

Please, I need help calculating the weighted median and confidence interval of for hospital_free_days by telemed_use  across 5 imputations.

The proc surveymeans is ignoring the class statement and also refusing to create the  ods output domain = outex1 ;

Please, I also need help with the right Proc MI analyze code.

I am using the following  SAS code.

Thank you.

 

proc  surveymeans data=Avera_matched_data  q1 q3 median;
class telemed_use;
strata telemed_use;
var Hospital_free_days4 ;
domain _imputation_ ;
 ods output domain = outex1 ;
run;

proc mianalyze data=outex1;
by Hospital_free_days4  telemed_use;*this would be the TABLES variable;
modeleffects median;
run;
3 REPLIES 3
ballardw
Super User

@UcheOkoro wrote:

Hello,

 

Please, I need help calculating the weighted median and confidence interval of for hospital_free_days by telemed_use  across 5 imputations.

The proc surveymeans is ignoring the class statement and also refusing to create the  ods output domain = outex1 ;

Please, I also need help with the right Proc MI analyze code.

I am using the following  SAS code.

Thank you.

 

proc  surveymeans data=Avera_matched_data  q1 q3 median;
class telemed_use;
strata telemed_use;
var Hospital_free_days4 ;
domain _imputation_ ;
 ods output domain = outex1 ;
run;

proc mianalyze data=outex1;
by Hospital_free_days4  telemed_use;*this would be the TABLES variable;
modeleffects median;
run;

When code "is ignoring the class statement and also refusing to create the  ods output domain = outex1 " or other unexpected behavior the first thing you should do is read the LOG. If you don't understand what the log means, then copy the entire log for the procedure or data step including all code and messages, notes, warnings and/or errors, open a text box on the forum using the </> icon at the top of the message window, and paste the text.

The text box is important because the message windows on the forum will reformat text and render many of the diagnostic bits that SAS provides in the log less useful.

 

 

UcheOkoro
Lapis Lazuli | Level 10

Hello Ballardw,

Thank you for you response.

The following is the log. I looked through my code but could not figure out what the problem is.

6266
6267  proc  surveymeans data=Avera_matched_data  q1 q3 median;
6268  class telemed_use;
6269  strata telemed_use;
6270  var Hospital_free_days4 ;
6271  domain _imputation_ ;
6272   ods output domain = outex1 ;
6273  run;

WARNING: Output 'domain' was not created.  Make sure that the output object name, label, or path
         is spelled correctly.  Also, verify that the appropriate procedure options are used to
         produce the requested output object.  For example, verify that the NOPRINT option is not
         used.
NOTE: PROCEDURE SURVEYMEANS used (Total process time):
      real time           9.77 seconds
      cpu time            0.26 seconds

 

 

ballardw
Super User

Please run this code and share the result.

Proc Freq data=Avera_matched_data;
  tables _imputation_  ;
run;

There are times when the various survey procedures do not "like" having the same variable on the STRATA statement and used in another role. You may need to add another variable with the same values as the STRATA variable to use as the Class variable.

 

Obviously don't have your data to test that last possibility.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 856 views
  • 0 likes
  • 2 in conversation