-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression #16
Comments
@laljeet is the DEQ irrigation here the one normalized by median historic withdrawal? Is it by county total? Thanks! |
In the above equation (lmer), it is by county. No transformations. |
Cool. Can we see a plot of this? Can we test for leverage of big or small values? |
Log Transformation of Response variablesCorrelation plot for predictor variables.Irrigation and precip are correlated, which is expected. The same is confirmed by VIF.vif.mer(lmm2) |
Thanks for sharing this.
|
Model form comparison - as a best practice, we should use an AIC criteria (I believe you can either do this within lme4 or the MuMin package) to investigate model form and eliminate unnecessary variables. Model forms to compare:
Do this for the Total Withdrawals and VDEQ Reported models. We'll mainly use the VDEQ reported results but should keep total just so we're consistent with what we scoped to USGS. We don't need to do the full scatterplot visualization and variable significance test for each form, but as a first step just create a table showing AIC values for each combination of parameters (all, 4, 2, and 1) and response variable (total and VDEQ reported withdrawals) We can also test forms where we replace log(W) as the response variable with (W_obs)/(W_mean), where W_mean is the long-term average value for a county. In this case, we probably can replace the mixed effects model form with a simple OLS regression because all of the intercept terms would be equal to 1. |
Thanks for laying these out @julieshortridge -- @laljeet I can't recall if you were computing deficit on the same rolling 2-day window as effective precip, or aggregating it seasonally. Or did you do a variation of Irr where you're adding daily deficit? If so, it can quite possibly be different math. FWIW, daily adding is certainly more appropriate imo in that if plants get no precip for 6 weeks then double precip for 3 weeks they won't make up that deficit. As I mentioned in the meeting, my preference would simply be to accumulate running total (ET-rain) and then have the irrigation facilities pump that value. To elaborate, I think the model would work best if we accumulate deficit on a 3-7 day frequency (for computing total), and have irrigators pump 1-2 days per week. This may or may not fit well with this approach but I wanted to lay out more detail on how I think of that process. |
Regression Parameters: Based on VIF (VIF < 3) for DEQ and Total WIthdarwals model
Selection of best model using AIC (lower AIC better model) Using builtin AIC command: Model 2 using four parameters gave the best results.
Total Withdrawals Model: <style> </style>
Also, I tried the dropt1 command it highlights the significant terms but doesn't provide AIC values. The significant model is the same four-parameter model. I also found another function in lmerTest that uses backward reduction: Here, the best-selected model was (Four parameter model without the random effect of (1|County) |
Normalized model: used stepwise elimination for best fit Norm_DEQ_withdarwals ~ PPT + Min_Temp + Extreme_days + GC |
@rburghol Currently, here and before, we are using the crop water demand for the whole cropping season. We did look into it, but we didn't change methodology for the calculation of unreported withdrawals. |
Thanks Lal, and good work on the variable selection piece. To compare the lmer and normalized models, I'd suggest calculating an R2 value for each using the withdrawal values in MG (ie, don't calculate on the log values or the normalized values, and don't use the R2 values from the lmer or glm output directly). That will be a good complement to the scatterplots. |
Thanks:
Looking forward to the 1 variable model as well. |
Predictor Variables:
Response Variable:
Could be any of
Equation used (confirm with Dr.Shortridge) :
lmm2 <- lmer(DEQ_Irrigation_withdrawals ~ PPT + Irrigation+Min_Temp+Mean_Temp+Max_Temp+Zero_PPT_days+ Extreme_days+SDI+GC+(1+YEAR|COUNTYFP),
data=dat2, REML = FALSE)
The effect of YEAR will vary between COUNTYFP. Random intercepts for YEAR, random slopes for COUNTYFP influenced by YEAR.??
The text was updated successfully, but these errors were encountered: