[R] mgcv: Extract random effects from gam model

2012-07-23 Thread janvanhove
Hi everyone, I can't figure out how to extract by-factor random effect adjustments from a gam model (mgcv package). Example (from ?gam.vcomp): library(mgcv) set.seed(3) dat - gamSim(1,n=400,dist=normal,scale=2) a - factor(sample(1:10,400,replace=TRUE)) b - factor(sample(1:7,400,replace=TRUE)) Xa

Re: [R] mgcv: Extract random effects from gam model

2012-07-23 Thread Simon Wood
Hi Jan , coef(mod) will extract the coefficients, including for a. They are labelled and for 'a' are in the same order as levels(a). best, Simon On 23/07/12 10:08, janvanhove wrote: Hi everyone, I can't figure out how to extract by-factor random effect adjustments from a gam model (mgcv