A sensor with the response Sw
shall be investigated if it is affected by external influences like Temperature Tu
and relative humidity rH
.
m1<- lm(Sw ~ Tu + rH + Tu:rH, data=data)
Coefficients:
(Intercept) Tu rH Tu:rH
9.927e-01 2.805e-04 9.455e-04 2.264e-05
summary.lm(rH_Dat_fit3)
Call:
lm(formula = Sw ~ Tu + rH + Tu:rH, data = rH_Dat_ges)
Residuals:
Min 1Q Median 3Q Max
-0.028543 -0.003187 0.001420 0.005486 0.018200
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.927e-01 4.443e-04 2234.38 <2e-16 ***
Tu 2.805e-04 7.961e-06 35.24 <2e-16 ***
rH 9.455e-04 8.649e-06 109.33 <2e-16 ***
Tu:rH 2.264e-05 1.591e-07 142.32 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.009133 on 8996 degrees of freedom
Multiple R-squared: 0.9817, Adjusted R-squared: 0.9817
F-statistic: 1.608e+05 on 3 and 8996 DF, p-value: < 2.2e-16
> AIC(m1)
[1] -58978
> BIC(m1)
[1] -58942.47
First, is that a correct expression to study these influences? Second, to study whether e.g. rH is necessary, the following model comes into mind:
m2<- lm(Sw ~ Tu, data=data)
Residuals:
Min 1Q Median 3Q Max
-0.046917 -0.020902 -0.003081 0.012441 0.073881
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.009e+00 5.202e-04 1939.5 <2e-16 ***
rH 2.036e-03 1.029e-05 197.8 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.02918 on 8998 degrees of freedom
Multiple R-squared: 0.8131, Adjusted R-squared: 0.813
F-statistic: 3.913e+04 on 1 and 8998 DF, p-value: < 2.2e-16
> AIC(m2)
[1] -38069.12
> BIC(m2)
[1] -38047.81
A colleague of mine asked me to have a look at (t)his analysis and I'm used to perform that a bit different but I'm not sure whether this makes a difference or not.
For example, when I want to know whether I need another parameter, I would run above models and compare them via an anova and the AIC, BIC and p-value would tell me whether I need this parameter. Is this different then when I look at these parameters only in regards to the single models?
Furthermore, when having a look at model m2
: Since there is only one explanatory variable isn't it obvious that it is necessary (due to the p-value)?
Sw
$\endgroup$