Hi, Please help.
I am trying to impute my data (contiounous), and these are the variables. Starting from y_T11, the missing starts.
I have my code as below. However, SAS always gave me error message
Variable N N Miss
y_T0 39 0
y_T1 39 0
y_T2 39 0
y_T3 39 0
y_T4 39 0
y_T5 39 0
y_T6 39 0
y_T7 39 0
y_T8 39 0
y_T9 39 0
y_T10 39 0
y_T11 37 2
y_T12 35 4
y_T13 34 5
y_T14 27 12
y_T15 25 14
y_T16 20 19
y_T17 16 23
y_T18 13 26
y_T19 6 33
y_T20 6 33
proc mi data=y_hr_wide nimpute=30 out=imp_reg seed=1234 ;
class gender; /*patient charactersitic data are not missing.*/
var gender age bmi y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10 y_T11 y_T12 y_T13 y_T14 y_T15 y_T16 y_T17 y_T18 y_T19 y_T20;
fcs regpmm(y_T11 = gender age bmi y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10) ;
fcs regpmm(y_T12 = gender age bmi y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10 y_T11) ;
fcs regpmm(y_T13 = gender age bmi y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10 y_T11 y_T12);
fcs regpmm(y_T14 = gender age bmi y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10 y_T11 y_T12 y_T13) ;
fcs regpmm(y_T15 = gender age bmi y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10 y_T11 y_T13 y_T14) ;
fcs reg(y_T16 = gender age bmi y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10 y_T11 y_T13 y_T14 y_T15) ;
fcs reg(y_T17 = gender age bmi y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10 y_T11 y_T13 y_T14 y_T15 y_T16) ;
fcs reg(y_T18 = gender age bmi y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10 y_T11 y_T13 y_T14 y_T15 y_T16 y_T17) ;
fcs reg(y_T19 = gender age bmi y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10 y_T11 y_T13 y_T14 y_T15 y_T16 y_T17 y_T18) ;
fcs reg(y_T20 = gender age bmi y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10 y_T11 y_T13 y_T14 y_T15 y_T16 y_T17 y_T18 y_T19) ;
run;
ERROR: Not enough observations to fit regression models for variable y_T16 with an FCS
regression method.
I am able to impute T11-T15 successfully, but every time starting T16, it failed. I searched online and I couldn't find anything. I tried to simplify the regression model many ways and still not working. What are the possible reasons and how to fix this? Please help! I am waiting online and Thanks a lot!
Regression cannot handle cases where you have less observations than predictors.
https://stats.stackexchange.com/questions/335263/more-predictors-than-observations
@AmyJuly wrote:
So you are saying that FCS cannot handle missing observations that are more than about 50%? As it is assumed MAR, the regression line can use the imputations just calculated, so I didn’t think this would be a problem. Do you have some more references on that?
Thanks. The question is even I downsized to only use one predictor, the same error is still there. I tried many ways to regress.
Show your full code and log please for your new code.
And check the cross between your missing data. For example, if you only have 6 values for the one variable and you're trying to predict it using another variable that has all missing it won't work either. For your last few I can see that easily happening.
proc mi data=y_hr_wide nimpute=30 out=imp_reg seed=1234 ;
var y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10 y_T11 y_T12 y_T13 y_T14 y_T15 y_T16 y_T17 y_T18 y_T19 y_T20;
proc mi data=y_hr_wide nimpute=30 out=imp_reg seed=1234 ;
var y_T0 y_T1 y_T2 y_T3 y_T4 y_T5 y_T6 y_T7 y_T8
y_T9 y_T10 y_T11 y_T12 y_T13 y_T14 y_T15 y_T16 y_T17 y_T18 y_T19 y_T20;
fcs regpmm(y_T11 = y_T0 y_T8 y_T9 y_T10) ;
fcs regpmm(y_T12 = y_T9 y_T10 y_T11) ;
fcs regpmm(y_T13 = y_T10 y_T11 y_T12);
fcs regpmm(y_T14 = y_T11 y_T12 y_T13) ;
fcs regpmm(y_T15 = y_T12 y_T13 y_T14) ;
fcs regpmm(y_T16 = y_T15) ;
fcs regpmm(y_T17 = y_T16) ;
fcs regpmm(y_T18 = y_T17) ;
fcs regpmm(y_T19 = y_T18) ;
fcs regpmm(y_T20 = y_T19) ;
run;
Even I downsized to only use one predictor, the same error is still there.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.