BookmarkSubscribeRSS Feed
AmyJuly
Fluorite | Level 6

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!

8 REPLIES 8
Reeza
Super User
Well, starting at T16 you have only 20 observations going down to 6 at the end.

If the model has 18 variables that's impossible mathematically as you have more predictors than observations.
You need more data or to drop some variables from the model.
AmyJuly
Fluorite | Level 6
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?
Reeza
Super User

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?

 

AmyJuly
Fluorite | Level 6

Thanks. The question is even I downsized to only use one predictor, the same error is still there. I tried many ways to regress.

Reeza
Super User

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. 

AmyJuly
Fluorite | Level 6

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;

Reeza
Super User
Show your full code and log please for your new code.
AmyJuly
Fluorite | Level 6

Even I downsized to only use one predictor, the same error is still there.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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