[R] t-test for regression estimate

Viechtbauer Wolfgang (STAT) wolfgang.viechtbauer at maastrichtuniversity.nl
Tue Jun 28 19:18:27 CEST 2016


But the second column in coef(summary(ols1)) gives you the SE, so why not use that? Otherwise, you may want to look into the 'multcomp' package and its glht() function.

Best,
Wolfgang

> -----Original Message-----
> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Steven
> Yen
> Sent: Tuesday, June 28, 2016 18:27
> To: R-help
> Subject: [R] t-test for regression estimate
> 
> test option for linearHypothesis in library(car) include "Chisq" and
> "F". I prefer a simple t-test so that I can retrieve the standard error.
> Any options other than linearHypothesis to test the linear hypothesis
> (with 1 restriction/degree of freedom)?
> 
>  > summary(ols1)
> 
> Coefficients:
>              Estimate Std. Error t value Pr(>|t|)
> (Intercept) -0.20013    0.09199  -2.176   0.0298 *
> age          0.04054    0.01721   2.355   0.0187 *
> suburb       0.01911    0.05838   0.327   0.7435
> smcity      -0.29969    0.19175  -1.563   0.1184
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> 
>  > linearHypothesis(ols1,"suburb")
> Linear hypothesis test
> 
> Hypothesis:
> suburb = 0
> 
> Model 1: restricted model
> Model 2: polideo ~ age + suburb + smcity
> 
>    Res.Df    RSS Df Sum of Sq      F Pr(>F)
> 1    888 650.10
> 2    887 650.02  1  0.078534 0.1072 0.7435


More information about the R-help mailing list