[R] mgcv 'bam' : prediction levels for random effects

lglew l.glew at soton.ac.uk
Wed Dec 14 17:17:56 CET 2011


Hi R users,

I'm using the 'bam' function in mgcv to examine trends in a remotely sensed
vegetation index.  I have one random effect variable, 'cons' (with six
levels) which identifies different subjects within this analysis.

My model is specified as follows:

rm4<-bam(trend~factor(zone)+s(cons,bs="re")+s(year,
bs="cc"),data=rain.data,family=gaussian(link="identity"),method="ML",na.action=na.omit,
rho=0.884)


I'm using the bam routine as the dataframe is very large (>300,000 rows of
data).  If possible, I'd like to extract the random effects from the fitted
gam object which is returned as I'm interested to know how dynamics vary
between subjects.  I'm aware that specifying the random effect using s()
with bs="re", is "dummying" a random effect, but I'm not sure if it is still
possible to extact the random effects levels using this method?

Thanks for your help,

Louise

--
View this message in context: http://r.789695.n4.nabble.com/mgcv-bam-prediction-levels-for-random-effects-tp4195614p4195614.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list