Formula for GAM with interaction and random term

by Ken T   Last Updated August 09, 2017 12:19 PM

I want to make a formula that present my model (for a report). The R code for the model is:

gam(infected ~ area + s(doy,by=area) + s(clength, by=area) + s(year,bs="re"), family=binomial(link="logit")

I have looked at others and think the below formula is accurate but am uncertain about the handling of interaction terms and random effect as subscript. Would like to be sure before i include it in the report:

Logit(πij) = β + fareaij + fk(doyij) + fk(clengthij)+ai

where j and k denote year and area respectively.

Thanks for corrections or other sugestions.

Tags : model gam formula


Related Questions



Four-part formula syntax in R

Updated April 02, 2017 13:19 PM


Formula for dropping dice (non-brute force)

Updated May 25, 2015 02:08 AM

R power.prop.test funciong formula

Updated May 22, 2017 16:19 PM