I have a daily collected time-series of temperature data that goes from 1981 to 2018 that look like this:
head(extracted_data)
value t quarter year
1 298.92 1981-08-25 Q3 1981
2 298.20 1981-08-26 Q3 1981
3 297.78 1981-08-27 Q3 1981
4 298.14 1981-08-28 Q3 1981
5 297.50 1981-08-29 Q3 1981
6 298.25 1981-08-30 Q3 1981
I'd like to build a regression model to get the annual change of temperature. In order to consider the seasonality of temperature, I built the model as the following:
model <- lm(value ~ quarter + year, data=extracted_data)
which gives me this:
summary(model)
Call:
lm(formula = value ~ quarter + year, data = extracted_data)
Residuals:
Min 1Q Median 3Q Max
-10.5027 -1.2918 -0.0495 1.1469 9.4846
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.060e+02 3.596e+00 57.28 <2e-16 ***
quarterQ2 4.506e+00 5.532e-02 81.45 <2e-16 ***
quarterQ3 1.161e+01 5.501e-02 210.97 <2e-16 ***
quarterQ4 4.909e+00 5.481e-02 89.56 <2e-16 ***
year 4.070e-02 1.798e-03 22.63 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.265 on 13638 degrees of freedom
Multiple R-squared: 0.7711, Adjusted R-squared: 0.771
F-statistic: 1.148e+04 on 4 and 13638 DF, p-value: < 2.2e-16
From this, can I say that the temperature is expected to increase by 0.0407 Kelvin degrees every year? Is the approach correct? I'm sorry I'm not a statistician!
lm(value ~ year, data=extracted_data)
. But follow @MrFlick's advice and post to CV. $\endgroup$ – Rui Barradas Nov 23 '20 at 17:04