# Combining cross-sectional data with panel data

Let's say I want to regress crop yield as a function of rainfall and temperature.

I collected data across 20 locations and 10 years and construct a model regressing yield on rainfall and temperature with location and year as random effects in R.

  mdl <- lmer(yield ~ rainfall + temperature + (1|location) + (1|year)


However, I know irrigation is quite important for crop yield. However, I have irrigation data only for one year across all the 20 locations. So I can construct a single model for a year using this:

mdl.yld <- lmer(yield ~ rainfall + temperature + irrigation + (1|location) # for a single year which has irrigation data


Can I use the regression coefficients of irrigation from mdl.yld and add to the regression equation inmdl so that I have an equation that predicts yield as a function of rainfall, temperature and irrigation?

• You can't simply throw in the irrigation here, because it'll be missing in other years. The MLE estimation should work here Commented Apr 13, 2018 at 18:45
• What does "irrigation" measure? Is it a yes/no variable? Is it time dependent? Commented Apr 13, 2018 at 18:57
• @Aksakal just to be sure are you thinking about this as a missing data problem? Would it be appropriate to impute irrigation? They would produce the same estimates I think. I don't know if there's enough detail to recommend a missing-data approach... Commented Apr 13, 2018 at 19:50
• @AdamO, no, I wonder if OP runs the model as in the given code, whether the model will treat it as missing data, and impute. I thought maybe if you explicitly write MLE for the model when irrigation is optional whether this would produce a better fit Commented Apr 13, 2018 at 20:05
• @Aksakal lmer does not impute data, unless I'm mistaken. Mixed models do have important connections with imputed analyses. I'm not aware that REML produces different estimates than ML in terms of how missing data are handled if that's what you're talking about. Maximum likelihood could also mean marginalizing the likelihood over missing values which is a complex likelihood. Commented Apr 13, 2018 at 20:08