[R] lm - significance disappears
Stuart Leask
stuart.leask at nottingham.ac.uk
Mon Mar 8 09:57:26 CET 2004
Hi there.
I am trying to model the effect of "Age at onset of a condition" (AGEONSET)
upon IQ (ie. do they have more problems if they get ill younger?). I also
want to see if there is an interaction with the TYPE of test (reading &
maths).
I am struggling to understand why the effect of AGEONSET, so very
significant in the non-interaction models, ceases to be so in the
interacting model? Am I using lm() wrongly here?
Stuart
****************************
# Regress IQ on AGEONSET, AGEONSET + TYPE, & AGEONSET*TYPE.
> fit.f<-lm(IQ~AGEONSET)
> summary(fit.f)
Call:
lm(formula = IQ ~ AGEONSET)
Residuals:
Min 1Q Median 3Q Max
-3.07434 -0.78350 0.04031 0.71869 2.82266
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.975267 0.077362 -12.607 < 2e-16 ***
AGEONSET 0.037158 0.006876 5.404 9.57e-08 ***
---
Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
Residual standard error: 1.109 on 574 degrees of freedom
Multiple R-Squared: 0.04841, Adjusted R-squared: 0.04675
F-statistic: 29.2 on 1 and 574 DF, p-value: 9.571e-08
> fit.f<-lm(IQ~AGEONSET+TYPE)
> summary(fit.f)
Call:
lm(formula = IQ ~ AGEONSET + TYPE)
Residuals:
Min 1Q Median 3Q Max
-3.03301 -0.80625 0.03662 0.72066 2.86379
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.852151 0.158755 -5.368 1.16e-07 ***
AGEONSET 0.037147 0.006877 5.401 9.71e-08 ***
TYPE -0.082107 0.092447 -0.888 0.375
---
Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
Residual standard error: 1.109 on 573 degrees of freedom
Multiple R-Squared: 0.04972, Adjusted R-squared: 0.0464
F-statistic: 14.99 on 2 and 573 DF, p-value: 4.513e-07
> fit.f<-lm(IQ~AGEONSET*TYPE)
> summary(fit.f)
Call:
lm(formula = IQ ~ AGEONSET * TYPE)
Residuals:
Min 1Q Median 3Q Max
-3.04133 -0.80869 0.03557 0.72420 2.86796
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.833399 0.244866 -3.403 0.000712 ***
AGEONSET 0.035070 0.021758 1.612 0.107555
TYPE -0.094608 0.154887 -0.611 0.541562
AGEONSET:TYPE 0.001386 0.013767 0.101 0.919868
---
Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
Residual standard error: 1.11 on 572 degrees of freedom
Multiple R-Squared: 0.04974, Adjusted R-squared: 0.04475
F-statistic: 9.979 on 3 and 572 DF, p-value: 2.026e-06
More information about the R-help
mailing list