[R-sig-ME] lmer problems; 1) bs-splines with interaction term, 2) model plotting
Wiebke Neumann
Wiebke.Neumann at vfm.slu.se
Tue Mar 24 16:13:14 CET 2009
Dear R users,
I am analyzing moose crossing roads in northern Sweden, where a GPS moose location gets a 1 when it is connected to road crossing event (1). I compare this dataset with a same-sized random sample of moose fixes that are not connected to any road crossing event (0). The explanatory variables include road density and julian day. I am trying to find out what could predict road crossings in moose to reduce collisions with cars. The lmer appeared most appropriate to handle large amount of data as well as take random effects into account and assign smoothers.
I have two questions regarding the lmer model frame.
1) How can I apply an interaction term in the lmer using continuous fixed factors with bs-splines and random effects? And how have the degrees of freedom to be assigned? Have they to be the sum of the main effects?
glmer(cross ~ bs(Rden)+ bs(j,df=4)+ bs(Rden,j,df=7)+(1|OBJECT_ID),family=binomial)
The following warning message is given by R.
1: In if (nIknots < 0) { :
the condition has length > 1 and only the first element will be used
2: In if (nIknots > 0) { :
the condition has length > 1 and only the first element will be used
3: In if (nIknots < 0) { :
the condition has length > 1 and only the first element will be used
4: In if (nIknots > 0) { :
the condition has length > 1 and only the first element will be used
5: In mer_finalize(ans) : gr cannot be computed at initial par (65)
2) What is the command to plot the model for model checking and to show the pattern of the terms contributing to the model in lmer?
I work on a Windows machine in R 2.8.1, Package lme4 version 0.999375-28 Index
Thanks for your help in advance.
Best regards, Wiebke Neumann
_________________________________________________________________
Wiebke Neumann
Dept. of Wildlife, Fish, and Environmental Studies
Faculty of Forest Science Swedish University of Agricultural Sciences, SLU
SE-90183 Umeå, Sweden
Office: +46 90 786 83 02
Mobile:+46 70 520 92 81
Fax: +46 90 786 81 62
Email: Wiebke.Neumann at vfm.slu.se http://www.moose-research.se/
More information about the R-sig-mixed-models
mailing list