r - Tensor smooths in gamm4 -
i trying extend model similar 1 described gavin simpson here include random effects. https://stats.stackexchange.com/questions/32730/how-to-include-an-interaction-term-in-gam
where loc
is replaced 4-level factor. fixed effects 2 categorical variables (a , b) , 2 continuous ones (c1 , c2) pairwise interactions. response 1s , 0s.
e.g.
gamm4(y~a*c1 + a*c2 + b*c1 + b*c2 s(yday, bs = "cc", k = 12) + s(yday, bs = "cc", = a, k = 12, m = 1) + s(hour, bs = "cc", k = 12) + s(hour, bs = "cc", = loc, k = 12, m = 1) + t2(hour, yday, = a, bs = rep("cc",2)), random = ~ (1 | id), family = "binomial"(link="logit"), data = dat)
trying run got error
error in x %*% diag(diagu[indi]) : non-conformable arguments
from lurking around in code of gamm4()
, gamm()
seems related penalising smooths within each level of random effect?
i running model subset of 4 individuals (can end around 40), , should nest individuals within years.
it problem situation specific (read: being way ambitious on behalf of data), reading gamm4()
still "construction phase" on matters makes me wonder if being ambitious on behalf of gamm4()
?
or plain wrong , off hiking in dead ends...
Comments
Post a Comment