[R] gam.check() NA results (k-index, p-value) of a gam logistic regression model

Fotis Fotiadis fotisfotiadis at gmail.com
Tue May 17 21:39:49 CEST 2016


Hello all

I am using bam for a mixec-effects logistic regression model:

b0<-bam(acc~ 1 + igc + s(ctrial, by=igc) + s(sbj, bs="re") + s(ctrial, sbj,
bs="re") , data=data, family=binomial)

>summary(b0)

Family: binomial
Link function: logit

Formula:
acc ~ 1 + igc + s(ctrial, by = igc) + s(sbj, bs = "re") + s(ctrial,
    sbj, bs = "re")

Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)
(Intercept)     2.8334     0.2030  13.955  < 2e-16 ***
igcPA.pseudo    0.4692     0.1285   3.650 0.000262 ***
igcCAT.ideo     0.3276     0.2906   1.127 0.259734
igcCAT.pseudo   0.6701     0.2945   2.275 0.022888 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
                           edf Ref.df Chi.sq  p-value
s(ctrial):igcPA.ideo     3.827  4.733  295.0  < 2e-16 ***
s(ctrial):igcPA.pseudo   3.317  4.110  356.1  < 2e-16 ***
s(ctrial):igcCAT.ideo    3.979  4.911  308.6  < 2e-16 ***
s(ctrial):igcCAT.pseudo  4.937  5.974  383.8  < 2e-16 ***
s(sbj)                  54.326 62.000 3032.8  < 2e-16 ***
s(ctrial,sbj)           43.045 62.000 2706.6 1.31e-08 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.362   Deviance explained = 38.9%
fREML =  25436  Scale est. = 1         n = 18417


I want to know if the wigglyness of the smooths [s(ctrial, by=igc)] is
appropriate, so I used the gam.check() function. The values though for
k-index and p-value are NAs:

> gam.check(b0)

Method: fREML   Optimizer: perf newton
full convergence after 5 iterations.
Gradient range [-7.60152e-08,8.12795e-06]
(score 25436.12 & scale 1).
Hessian positive definite, eigenvalue range [0.6271375,24.46625].
Model rank =  168 / 168

Basis dimension (k) checking results. Low p-value (k-index<1) may
indicate that k is too low, especially if edf is close to k'.

                           k'   edf k-index p-value
s(ctrial):igcPA.ideo     9.00  3.83      NA      NA
s(ctrial):igcPA.pseudo   9.00  3.32      NA      NA
s(ctrial):igcCAT.ideo    9.00  3.98      NA      NA
s(ctrial):igcCAT.pseudo  9.00  4.94      NA      NA
s(sbj)                  64.00 54.33      NA      NA
s(ctrial,sbj)           64.00 43.04      NA      NA

Does anyone know why is this?

Thank you in advance for your time,
Fotis

P.S. I am using RStudio Version 0.99.896, R 3.3.0, and mgcv package version
1.8.12.
--
PhD Candidate
Department of Philosophy and History of Science
University of Athens, Greece.
http://users.uoa.gr/~aprotopapas/LLL/en/members.html#fotisfotiadis

Notice: Please do not use this account for social networks invitations, for
sending chain-mails to me, or as it were a facebook account. Thank you for
respecting my privacy.

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Απαλλαγμένο
από ιούς. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

	[[alternative HTML version deleted]]



More information about the R-help mailing list