BookmarkSubscribeRSS Feed
Alib
Calcite | Level 5

Hello,

 

I'm a beginner on SAS. I need to use multiple imputation using chained equations (FCS) to deal with missing values.

I want to use fitted linear regression models for a continuous variable X (fourth root) and fitted multinomial regression for nominal variable Y (4 categories) to create 10 imputed datasets; analyses are run separately and their results would be combined by use of Rubin's method.

 

Can someone help me for syntax?

 

Thanks

 

 

6 REPLIES 6
SAS_Rob
SAS Employee

 

The approach from a syntax standpoint would be similar to this example

http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_mi_examples0...

 

The only difference in your case would be that rather than using the DISCRIM method, you would use the LOGISTIC method.

fcs logistic (species/link=glogit);

 

 

 

Alib
Calcite | Level 5

Thanks,

I use this syntax

proc mi data=table1 seed=1305417 nimpute=10 out=imputedtable1;
   class slevel sex period city death;
   fcs logistic(slevel/link=glogit) logistic(period/link=glogit) reg(rate/details);
   var slevel sex period city death rate time_log ;
run;

It worked. Can I use proc mianalyze to combine results from the 10 imputations? If not, what can i use to combine their results?

 

SAS_Rob
SAS Employee

The way it actually works is that you next run whatever analysis you were planning to run (regression for example) and then use MIANALYZE to combine the estimates from that analysis.

 

There is a good description of the three step process here in the documentation.

http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_mianalyze_ov...

 

Alib
Calcite | Level 5

I perform univariate competing risk with this syntax but i have many errors from sas

data slevel;
	slevel=1;output;
	slevel=2;output;
	slevel=3;output;
	slevel=4;output;
	format slevel slevel.;
	run;

Proc phreg data=pop1_imput1 plots (overlay=stratum)=cif;
	format slevel slevel.;
	class slevel (param=ref ref='Primary');
	model delriskc1*riskc1(0)=slevel/eventcode=1 risklimits;
	baseline covariates=slevel out=outslevel cif=_all_;
by _Imputation_; 
ods output parameterEstimates  = a_mvn CovB=mxcovb;
	run;

proc mianalyze parms(classvar=full)=a_mvn COVB(effectvar=rowcol)=mxcovb;
class slevel;
modeleffects slevel;
RUN;

ERROR: Event Stack Underflow. This is probably caused by mis-matched begin and end event calls

ERROR:  An exception has been encountered.
Please contact technical support and provide them with the following traceback information:

The SAS task name is [PHREG]
ERROR:  Read Access Violation PHREG
Exception occurred at (06497DDF)
Task Traceback
Address   Frame     (DBGHELP API Version 4.0 rev 5)
0000000006497DDF  000000007FC24270  sasods:tkvercn1+0x126D9F
000000000CA383B9  000000007FC24278  sasstgr:tkvercn1+0x57379
000000000CA6465A  000000007FC24BC0  sasstgr:tkvercn1+0x8361A
000000000CA54506  000000007FC24E80  sasstgr:tkvercn1+0x734C6
000000000739677A  000000007FC24E88  sasoda:tkvercn1+0x2573A
000000000738FA18  000000007FC24FC0  sasoda:tkvercn1+0x1E9D8
000000000739677A  000000007FC25000  sasoda:tkvercn1+0x2573A
00000000073724F8  000000007FC25610  sasoda:tkvercn1+0x14B8
000000000F4C6CFA  000000007FC25618  sasmrk:tkvercn1+0x105CBA
000000000F453FD1  000000007FC25B90  sasmrk:tkvercn1+0x92F91
000000000F388A6A  000000007FC25B98  sastags:tkvercn1+0x47A2A
000000000F36C343  000000007FC26180  sastags:tkvercn1+0x2B303
000000000E9CDC6A  000000007FC26188  sasxml:tkvercn1+0x4CC2A
000000000E982548  000000007FC26260  sasxml:tkvercn1+0x1508
000000000653F63A  000000007FC262A0  sasods:tkvercn1+0x1CE5FA
0000000006433576  000000007FC265C0  sasods:tkvercn1+0xC2536
00000000063CEECA  000000007FC26CA0  sasods:tkvercn1+0x5DE8A
000000000653F63A  000000007FC26CE0  sasods:tkvercn1+0x1CE5FA
00000000063E4690  000000007FC2AC70  sasods:tkvercn1+0x73650
000000000653F63A  000000007FC2ACB0  sasods:tkvercn1+0x1CE5FA
00000000063D4C99  000000007FC2CF40  sasods:tkvercn1+0x63C59
000000000F156FBA  000000007FC2CF48  sasphreg:tkvercn1+0x295F7A
000000000F0B0AD1  000000007FC2D600  sasphreg:tkvercn1+0x1EFA91
000000000F0AE1C8  000000007FC2E080  sasphreg:tkvercn1+0x1ED188
000000000EEC15F8  000000007FC2FBF0  sasphreg:tkvercn1+0x5B8
00000000031A8A2B  000000007FC2FBF8  sashost:Main+0x10F0B
00000000031AE66D  000000007FC2FF50  sashost:Main+0x16B4D
00007FFC4BC42774  000000007FC2FF58  KERNEL32:BaseThreadInitThunk+0x14
00007FFC4DE30D51  000000007FC2FF88  ntdll:RtlUserThreadStart+0x21


ERROR:  An exception has been encountered.
Please contact technical support and provide them with the following traceback information:

The SAS task name is [PHREG]
ERROR:  Read Access Violation PHREG
Exception occurred at (0CA645F9)

 

ERROR: File WORK.MXCOVB.DATA does not exist.

 

Thanks

SAS_Rob
SAS Employee

That first ERROR usually has something to do with changes made to the output template.  I would contact technical support to ask about the second.

 

In the mean time you might also try simplifying your PHREG code so that only what you need for MIANALYZE will be produced.

 

Proc phreg data=pop1_imput1;
	format slevel slevel.;
	class slevel (param=ref ref='Primary');
	model delriskc1*riskc1(0)=slevel/eventcode=1;
by _Imputation_; 
ods output parameterEstimates  = a_mvn;
	run;

proc mianalyze parms(classvar=full)=a_mvn;
class slevel;
modeleffects slevel;
RUN;

run;
Alib
Calcite | Level 5

Thanks Rob,

 

After use of proc mianalyze statement,i used this syntax

data u_slevel2; set u_slevel1;
HR_est=EXP(ESTIMATE);
LCI_HR=HR_est*EXP(-1.96*STDERR);
UCI_HR=HR_est*EXP(+1.96*STDERR);
RUN;

proc print data=u_slevel2;
var Parm slevel Probt HR_est LCI_HR UCI_HR;
run;

and I've had p-value and hazards ratio by class but i need p-value for all categories (global p-value of slevel), how i can get it?

 

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