BookmarkSubscribeRSS Feed
edasdfasdfasdfa
Quartz | Level 8

Hey guys,

 

So I am doing some multiple imputation. As some of you know, there are three steps to this. The second step requires use of PROC SURVERYLOGISTIC. I think it's main role is to save the parameter estimates for the final step. Is there an alternative to using it so i can accomplish all three steps?

 

 

15 REPLIES 15
PaigeMiller
Diamond | Level 26

I don't think that's the only thing that SURVEYLOGISTIC does, but I think it unlikely that some other combination of data step and PROCs will get the same results — unless you are willing to do a large amount of programming.

--
Paige Miller
edasdfasdfasdfa
Quartz | Level 8

I did just the first step of the three step imputation process (which did fill in the values)..and did perfectly well when I fit the train data to the validation. (a bit over 80% accuracy)...so not sure..are the three steps always necessary?

ballardw
Super User

Are talking about using Proc MI or some other process?

 

 

edasdfasdfasdfa
Quartz | Level 8

Yes, I used proc mi to impute based on all the guidelines. But then couldn't do the second step.

PaigeMiller
Diamond | Level 26

You have left out some important details.

 

But then couldn't do the second step.

 

Why not? What did you try to do? What stopped you? What happened?

 

And also: what exactly is the second step, anyway? Give us the details.

--
Paige Miller
edasdfasdfasdfa
Quartz | Level 8

Hi Paige,

 

I am following the procedures in a book called 'Multiple Imputation of missing data using SAS'. The first requires use of proc mi (which I have access to). Here is an example:

 

proc mi nimpute=3 data=c7_ex1 seed=55 out=c7_ex1_imp;
 class racecat gender edcat selfrhealth diabetes arthritis stratum_secu;
 fcs plots=trace(mean(bodywgt)) nbiter=20 logistic (edcat diabetes arthritis)
   discrim(racecat=gender edcat selfrhealth diabetes arthritis
   /classeffect=include) regression (bodywgt);
 var stratum_secu kwgtr kage gender racecat edcat diabetes arthritis bodywgt
   selfrhealth;
run;

 

The second step however requires use of proc surveylogistic which I don't have access to. To do this aspect:

 

proc surveylogistic data=c7_ex1_imp;
 weight kwgtr; strata stratum; cluster secu;
 by _imputation_;
 class racecat gender edcat selfrhealth / param=ref;
 model diabetes (event='1')=gender racecat selfrhealth bodywgt;
 ods output parameterestimates=c7_ex1_est;
run;

proc print data=c7_ex1_est;
run ;

 

The final step requires proc mianalyze which I have:

 

proc mianalyze parms(classvar=classval)=c7_ex1_est edf=56;
 class racecat gender selfrhealth;
 modeleffects intercept gender racecat selfrhealth bodywgt;
run;

PaigeMiller
Diamond | Level 26

This was not obvious when you originally stated your problem.

 

However, if you have PROC MI, you should have PROC SURVEYLOGISTIC, they are both part of SAS/STAT.

 

What happens when you try to use PROC SURVEYLOGISTIC?

--
Paige Miller
edasdfasdfasdfa
Quartz | Level 8
I'm using a software called WPS that does not have access to this..at least not yet.
PaigeMiller
Diamond | Level 26

Well, there really is no replacement for PROC SURVEYLOGISITIC, unless you want to do a large amount of programming.

--
Paige Miller
edasdfasdfasdfa
Quartz | Level 8

Can't I just use this solution?

 

https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html

 

  1. Use ODS TRACE ON (or the SAS documentation) to find the name of the ODS table that contains the statistic that you want.
  2. Use the ODS OUTPUT statement to specify the table name and a data set name. The syntax is ODS OUTPUT TableName=DataSetName. Then run the procedure to generate the table.
  3. Read the data set to obtain the value of the statistic.

I know that proc surveylogistic does many things but I think in my context, all I need really is to have some way to store the parameter estimates so that they can be read in the final step of multiple imputation (by proc mianalyze, which I have)

 

 

PaigeMiller
Diamond | Level 26

ODS OUTPUT can collect the results from PROC SURVEYLOGISTIC, which means you have to run PROC SURVEYLOGISTIC, but you have told me you can't.

--
Paige Miller
edasdfasdfasdfa
Quartz | Level 8

Would you be able to tell me if it is totally unnecessary to use proc surveylogistic (for missing values) unless you are using survey data?

PaigeMiller
Diamond | Level 26

At this point, I would like you to describe the problem and the analysis in detail. I feel I have been guessing at a lot of things.

--
Paige Miller
ballardw
Super User

@edasdfasdfasdfa wrote:

Hi Paige,

 

I am following the procedures in a book called 'Multiple Imputation of missing data using SAS'. The first requires use of proc mi (which I have access to). Here is an example:

 

proc mi nimpute=3 data=c7_ex1 seed=55 out=c7_ex1_imp;
 class racecat gender edcat selfrhealth diabetes arthritis stratum_secu;
 fcs plots=trace(mean(bodywgt)) nbiter=20 logistic (edcat diabetes arthritis)
   discrim(racecat=gender edcat selfrhealth diabetes arthritis
   /classeffect=include) regression (bodywgt);
 var stratum_secu kwgtr kage gender racecat edcat diabetes arthritis bodywgt
   selfrhealth;
run;

 

The second step however requires use of proc surveylogistic which I don't have access to. To do this aspect:

 

Procs MI and Surveylogistic are both part of SAS/STAT. If one is installed the other should be as well. Why do you not have access to Surveylogistic?

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

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
  • 15 replies
  • 1187 views
  • 0 likes
  • 4 in conversation