When using PROC MI I was provided some code but it does not work. In my dataset I have three treatment values (1 2 3).
There are two MNAR calls in the code, one is for TRT = 3 and the other is for TRT 1 and 2 combined. PROC MI says the following code is not allowed because a symbol other an equal "=" isn't allowed. Any thoughts on how to make this work are appreciated.
proc mi data=&data seed=123 nimpute=100 out=outmi;
class trtpn;
fcs reg;
mnar adjust (m12/shift=&k1 adjustobs=(trtpn^=3));<<<<<<<<<<<<<<<<<<<<<<-this line causes an error
mnar adjust (m12/shift=&k2 adjustobs=(trtpn=3));
var m3 m6 m12 m24 m36 ;
run;
Yes, alternatively, you can use a list inside the parenthesis. This approach in your case might be easier so I would recommend that.
mnar adjust (m12/shift=&k1 adjustobs=(treatnp='1' '2'));
I think @SAS_Rob can help you out.
(he's being notified due to me @-mentioning him here)
MI will only allow you to use an = sign in adjustobs= option.
My suggestion would be to create a new variable that only has two levels to it, the combined 1,2 and 3 using a data step by defining it something like this:
trtpn_new=(trtpn ne 3);
Then use that variable in the Proc MI step.
proc mi data=&data seed=123 nimpute=100 out=outmi;
class trtpn_new;
fcs reg;
mnar adjust (m12/shift=&k1 adjustobs=(trtpn_new=1));
mnar adjust (m12/shift=&k2 adjustobs=(trtpn_new=0));
var m3 m6 m12 m24 m36 ;
run;
Rob,
Thanks for the suggestion. Would something like this work as an alternative:
mnar adjust (m12/shift=&k1 adjustobs=(treatnp='1' '2'));
mnar adjust (m12/shift=&k2 adjustobs=(treatnp='3'));
I'm fine using your solution as well.
Yes, alternatively, you can use a list inside the parenthesis. This approach in your case might be easier so I would recommend that.
mnar adjust (m12/shift=&k1 adjustobs=(treatnp='1' '2'));
Rob - thanks. One other item isn't quite working for me.
Let's say my change mean for treatment groups= -100
Let's say my control change mean = -200
I set S1 = -100 and S2 = -200 then my increment is +15 if I want 20 equal intervals. Is this correct?
The MI output doesn't look right - the shift values appear to be going the wrong way as the model iterates. Any thoughts?
Rob,
As it turns out the model code I was given contained an error, so that S2 was not properly computed. Once I corrected it, the code ran as expected.
Thanks for your help!
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →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.