[R] significance of random effect in mgcv gam

William Shadish wshadish at ucmerced.edu
Tue Dec 3 20:09:23 CET 2013


Dear R-helpers,

I would like to test whether a random effect is significant when 
implemented with bs="re" in mgcv gam. For example, if I run:

M3b <- gam(DVY  ~ s(SessIDX, fTX, bs = "re") + factor(TX),
            data = PCP,
            family = quasipoisson(link="log"), method="REML")
summary(M3b,all.p=TRUE)
gam.vcomp(M3b)

I obtain the the following output:

 > summary(M3b,all.p=TRUE)

Family: quasipoisson
Link function: log

Formula:
DVY ~ s(SessIDX, fTX, bs = "re") + factor(TX)

Parametric coefficients:
             Estimate Std. Error t value Pr(>|t|)
(Intercept)   1.3282     0.2244   5.920 2.74e-07 ***
factor(TX)1  -1.0546     0.7210  -1.463     0.15
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
                  edf Ref.df     F p-value
s(SessIDX,fTX) 1.052      2 1.138   0.126

R-sq.(adj) =  0.388   Deviance explained = 39.5%
REML score =  37.67  Scale est. = 1.4172    n = 54
 > gam.vcomp(M3b)

Standard deviations and 0.95 confidence intervals:

                   std.dev      lower     upper
s(SessIDX,fTX) 0.07842742 0.01095655 0.5613865
scale          1.19029872 0.97816911 1.4484316

Rank: 2/2

Question. Am I correct that p = .126 above can be taken as the p-value 
associated with the random effect?

Thanks.

Will Shadish

-- 
William R. Shadish
Distinguished Professor
Founding Faculty

Mailing Address:
William R. Shadish
University of California
School of Social Sciences, Humanities and Arts
5200 North Lake Rd
Merced CA  95343

Physical/Delivery Address:
University of California Merced
ATTN: William Shadish
School of Social Sciences, Humanities and Arts
Facilities Services Building A
5200 North Lake Rd.
Merced, CA 95343

209-228-4372 voice
209-228-4007 fax (communal fax: be sure to include cover sheet)
wshadish at ucmerced.edu
http://faculty.ucmerced.edu/wshadish/index.htm
http://psychology.ucmerced.edu



More information about the R-help mailing list