[R] lm - significance disappears
Prof Brian Ripley
ripley at stats.ox.ac.uk
Mon Mar 8 11:35:11 CET 2004
On Mon, 8 Mar 2004, Stuart Leask wrote:
> 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?
First, the meaning of AGEONSET changes. Assuming TYPE is a 2-level factor
and AGEONSET is continuous, this is not an interaction per se but a model
with one line for both types vs separate lines for both types.
>From now on I need to assume standard (that is treatment) contrasts.
In your final model, AGEONSET is the slope for the line in the first
group: maybe that group is the smaller, as the standard error is 3x
larger? AGEONSET:TYPE is the difference in slopes: that is determined
well but is small.
It helps to look at both the size of the coefficient and its se, as well
as their ratio.
>
>
> 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
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list