BookmarkSubscribeRSS Feed
seltonsy
Quartz | Level 8

Hi everyone,

 

I have a question regarding mcmc imputation. From what I understand, the 1st step should be the imputation phase with  proc mi data= ........

 

then the 2nd should be the analysis phase: e.g proc glm.......

and the 3rd is the pooling phase with proc mianalyze ......

 

My Question: I used mcmc in the 1st step and would like to include more than one variable in the 2nd step since I have more than one variable to impute:

 

The problem is that  only the last model statement is used: ( WARNING: Only the last MODEL statement is used.)

 

If I can only model one variable at a time, how can I combine those together in the end.??

 

Here is the code:

 

proc mi data=cohort1 nimpute=20 out=cohort_MCMC_1
seed=2017
round= 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
min= 14 1 0 0 0 0 0 0 0 0 0 0 30 1 0 0 0 0 0 0 0 0 0 0 0 1200 1200 1200 1200
max= 45 20 10 20 1 1 1 1 1 1 1 1 42 9 1 1 1 1 1 10 10 10 10 10 10 5500 5000 5000 5000  ;
mcmc impute=monotone ;
var x1 x2 x3  x4 -------- x20 ;
run ;

 

/**************************************************************************************/
proc glm /* or mixed  */ data=cohort_MCMC_1 ;
class x1 x2 x3 ------x10;
model x1= x1------x5;
model x2= x2-----x7;
model x3= x6-------x15 ;
model x4= x4------x20;
by _imputation_;
ods output ParameterEstimates=gm_mcmc;
run;

 

 

1 REPLY 1

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 782 views
  • 0 likes
  • 2 in conversation