# R Linear model step NA values

My aim is to carry out a generalized linear model (glm) with 1 response variable and 13 explanatory variables.Unfortunately 3 out of the 10 explanatory variables contain NA values (2/3 of data set of this 3 variables are NA values - in total 410 observations). I realized that the "step" function does not work with NA values (Why does the number of rows change during AIC in R? How to ensure that this doesn't happen?). Therfore my question: How can I proceed to automatically improve my glm without eliminating my sites with NA values?

Example (only 3 explanatory variables and 5 observations)

• Can you impute the values? How many observations are in your dataset and can you tell us a bit more about why the data might be missing? – StatsStudent Apr 10 '15 at 20:46
• I added an example table. Does that clarify my question? Observations are missing because they were not measured at all sites. – kalakaru Apr 10 '15 at 20:54
• Something doesn't seem right here. You only have 5 observations and you want to build a model with 13 explanatory variables? That just won't work. I must be missing something. Can you clarify? – StatsStudent Apr 10 '15 at 20:55
• well no, that was just an example dataset... I actually have 410 observations. sorry for the confusion! – kalakaru Apr 10 '15 at 20:57

• If you are intending to use your model for predictions on new data sets and the variables with many NAs are often unavailable in practice, it might be best to omit such hard-to-obtain variables. Also, stepwise selection is not generally a very good way to build a model. See CV pages with the stepwise-regression tag, for example this page. – EdM Apr 10 '15 at 22:10