2
$\begingroup$

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)?

$\endgroup$
4
  • 1
    $\begingroup$ how did you collect your data? $\endgroup$
    – carlo
    Commented Nov 20, 2019 at 8:43
  • $\begingroup$ I didn't :) but temperature and humidity were recorded manually by hand.. $\endgroup$
    – Ben
    Commented Nov 20, 2019 at 9:05
  • 1
    $\begingroup$ ok but what was the sampling scheme? my concern is that you may think you are measuring the impact of temperature and humidity on the sensor, and instead you are measuring their generic association with Sw $\endgroup$
    – carlo
    Commented Nov 20, 2019 at 9:15
  • 1
    $\begingroup$ 9000 measurements taken by hand? Wow. That must be important to someone. I grow to think that discussing two simple linear models in a forum thread does not quite meet that importance? $\endgroup$
    – Bernhard
    Commented Nov 20, 2019 at 9:25

1 Answer 1

1
$\begingroup$

First, is that a correct expression to study these influences?

It is if you can rule out non-linear, especially U-shaped influences, in which case you could consider quadrativ terms, e. g.

m1<- lm(Sw ~ Tu*rH + I(Tu^2) + I(rH^2), data = data)

but that will depend on your knowledge about how the sensor works.

Second, to study whether e.g. rH is necessary

rHis super-significant in the statistical meaning of the term "significance" with $p<10^{-15}$, so we know that rH definitively plays a role. Models without it will fit worse. However, you have to define what "necessary" means in your specific context. Maybe the influence is so small that it does not matter, even though it is statistically significant. The estimated coefficient for rHis 9.455e-04 = .0009455. Is it necessary to know when using the sensor?

$\endgroup$
6
  • $\begingroup$ First, thanks a lot! So I do not need to compare 'm1' with 'm2'? You're right, how do I check whether it is necessary? I don't understand the last sentence? $\endgroup$
    – Ben
    Commented Nov 20, 2019 at 8:44
  • $\begingroup$ Normal peak blood pressure is 120 mmHg. Measurement error is >10 mmHg and variance within a day is large. If some drug significantly lowers the blood pressure by 1 mmHg than it has a statistically significant effect of no patient value. The effect is statistically significant but not medically significant. With m1 you have residuals between -0.029 and +0.0182. With m2 you have residuals between -0.047 and +0.074. If measuring rH is expensive and changes in Sw are only of interest when larger than 0.1, then rH is "not necessary" to measure. $\endgroup$
    – Bernhard
    Commented Nov 20, 2019 at 8:51
  • $\begingroup$ That's interesting. How do you interprete this? Is it that for residual min -0.029 and -0.047 do not play a huge role and analogue to residual max? $\endgroup$
    – Ben
    Commented Nov 20, 2019 at 9:09
  • 1
    $\begingroup$ It is not a question of interpretation but rather of the matter to investigate. -0.029 in blood pressure is nothing, -0.029 in the mass of neutrinos changes the world of cosmology. Your question is: "Do I need to measure relative humidity each time I use this sensor to measure Sw". That is not a statistical question, it is a question to people who want to measure Sw, whatever Sw is. Those people will probably not be interested in AIC oder BIC but they will be interested in residuals. Preferably out-of-sample residuals. $\endgroup$
    – Bernhard
    Commented Nov 20, 2019 at 9:21
  • 1
    $\begingroup$ Again, I try to see it from the point of those who want to use the sensor to measure Sw. I assume they are more interested in the error in absolute values then in explained variance. But that is only an assumption as I do not know why anybody would want to measure Sw. If measuring rH is cheap though, we know that it leads to better predictions. $\endgroup$
    – Bernhard
    Commented Nov 20, 2019 at 10:16

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.