2
$\begingroup$

Any help with my problem could be appreciated. So I'm trying to run a linear model comparing four sets of climate data (daily temperature, daily relative humidity, daily precipitation, and daily solar radiation) to two sets of growth data for willow trees (diameter and height). The climate data was recorded on a daily basis over the course of the growing season (5 months) over 3 years, while the growth data was recorded at the end of each of these 3 years when each growing season ended and the growth for that year has ended.

Now I'm trying to run a linear model comparing how the climate variables may be affecting these growth factors, but I can't seem to make it work. Do I need to ensure that the time frames for both climate and growth variables are the same? Meaning, should I average the climate variables to get averages I can compare against with the yearly records of the growth variables? And if so, how should I go about doing it correctly? Considering I keep getting results like this if I average the climate data and compare it against the yearly growth data:

Call:
lm(formula = Maxht ~ temp + RH + Precip + Rad, data = g1)

Residuals:
    Min      1Q  Median      3Q     Max 
-373.06  -26.60    4.57   32.57  158.20 

Coefficients: (2 not defined because of singularities)
             Estimate Std. Error t value Pr(>|t|)    
(Intercept) 17674.190   1460.144   12.10   <2e-16 ***
temp         -768.808     67.886  -11.32   <2e-16 ***
RH            -58.125      4.272  -13.61   <2e-16 ***

Precip             NA         NA      NA       NA    
Rad                NA         NA      NA       NA    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 51.05 on 357 degrees of freedom
Multiple R-squared:  0.4514,    Adjusted R-squared:  0.4483 
F-statistic: 146.9 on 2 and 357 DF,  p-value: < 2.2e-16

Any help would be appreciated and I'd be happy to explain as best as I can to clarify if needed.

Thank you.

$\endgroup$
2
  • $\begingroup$ Are you sure your variables, Precip and Rad are okay? They look NA in the model. $\endgroup$
    – SmallChess
    Commented Nov 21, 2015 at 5:40
  • 2
    $\begingroup$ Yes, you have to average your climate data in a meaningful way so that you end up with a single value for each growing season. The NAs in the model most likely came up because there is insufficient data to estimate the model as it is specified since there are only three data points (i.e. years in which height was measured) and four independent variables. But it would be best if you would provide some data with that output. $\endgroup$
    – Stefan
    Commented Nov 21, 2015 at 6:10

1 Answer 1

1
$\begingroup$

You have the growth data for only three years, so essentially you have just three samples of dependent variable. Seeing that you have 357 degrees of freedom, I am guessing that you gave the year-end growth variable for each daily weather data and ran the regression. If that's the way you are doing it, I fear the model is not constructed properly.

You would want to predict how each day's weather is affecting your year-end growth. So you are left with just 3 samples here. And let's have a look at the predictors: 4 weather variables (daily temperature, daily relative humidity, daily precipitation, and daily solar radiation) for each day in the season (5 months) - so you have around 4*5*30 = 600 variables.

So you would need much larger data set than the 3 samples you have here. I guess your model can look at something like this:

Maxht ~ temp_Day1 + RH_Day1 + Precip_Day1 + Rad_Day1 + temp_Day2 + RH_Day2 + Precip_Day2 + Rad_Day2 + .......till day 150;

You can try the following things to make the model work:

First point is to see if you can have a larger sample size. You can do this probably by increasing the time frame, or including the data from some other geographies for the crop you are considering. Second is to reduce your predictor variables to very very few, considering your sample size would at-most be in double digits. You can try this by compressing the variables, say take weekly, monthly or full season avg, min or max values (as the extremes may affect the crop growth) and reduce the total variables to ~5-10.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.