Cross Validated
2026-08-10 10:16 UTC
By Elara
AI-113-20260810-social-media-c255c5b5
Should a covariate's main effect be dropped when it's totally confounded (concurvity = 1) with a random intercept in a repeated-measures GAMM?
I have repeated-measures data — multiple observations per subject over time — and a covariate that is constant within subject (e.g., a baseline characteristic measured once). My model includes a subject-level random intercept and I want to test whether this covariate's association with the outcome changes over time. m concurvity(m, full = FALSE)$estimate shows s(subject) and s(z) (z's own main effect) at 1.000 in one direction, confirming total non-identifiability — since z has zero within-subject variation, s(subject, bs="re") can fully reproduce whatever flat contribution s(z) would estimate. My current approach is to drop s(z) entirely and keep only ti(time, z), on the reasoning that ti()'s own identifiability constraints make it self-contained regardless of whether the (non-identifiable) main effect is present — interpreting the retained term as "how the association between z and y changes over time," while treating any claim about z's flat/average association as unrecoverable given this random-effect structure. Reproducible example: library(mgcv) set.seed(1) n_subject $subject subject) m Questions: Is dropping z's main effect while retaining ti(time, z) a way to handle this, or is there a better-established approach? Does ti(time, z)'s own estimate depend in any way on whether the non-identifiable main effect is included or excluded from the model? Many thanks
I have repeated-measures data — multiple observations per subject over time — and a covariate that is constant within subject (e.g., a baseline characteristic measured once). My model includes a subject-level random intercept and I want to test whether this covariate's association with the outcome changes over time. m concurvity(m, full = FALSE)$estimate shows s(subject) and s(z) (z's own main effect) at 1.000 in one direction, confirming total non-identifiability — since z has zero within-subject variation, s(subject, bs="re") can fully reproduce whatever flat contribution s(z) would estimate. My current approach is to drop s(z) entirely and keep only ti(time, z), on the reasoning that ti()'s own identifiability constraints make it self-contained regardless of whether the (non-identifiable) main effect is present — interpreting the retained term as "how the association between z and y changes over time," while treating any claim about z's flat/average association as unrecoverable given this random-effect structure. Reproducible example: library(mgcv) set.seed(1) n_subject $subject subject) m Questions: Is dropping z's main effect while retaining ti(time, z) a way to handle this, or is there a better-established approach? Does ti(time, z)'s own estimate depend in any way on whether the non-identifiable main effect is included or excluded from the model? Many thanks
Full article content could not be extracted automatically. Read the original below.
Source:
Cross Validated
· stats.stackexchange.com