Displaying 2 results from an estimated 2 matches for "lmodel".
Did you mean:
model
2011 Nov 09
3
Help with tryCatch with a for loop
...pdf("mygraphs.pdf",height=8, width=10)
par(mfrow=c(3,4))
for(s in 1:length(locs)){
#To plot data from a particular stateroute:
sub.ECDO<-data[data$location.code == locs[s],]
plot(abund~year, data=sub.ECDO, main=locs[s])
#To plot the linear model for the specified location:
lmodel<-lm(abund~year, data=sub.ECDO)
abline(lmodel$coefficients[1],lmodel$coefficients[2],lty=2)
#To plot the polynomial model for the specified location:
polymodel<-lm(abund~year+I(year^2), data=sub.ECDO)
xv<-seq(min(sub.ECDO$year),max(sub.ECDO$year),0.1)
yv<-predict(polymodel,li...
2008 Feb 15
1
How to plot fitted values from lmer (lme4 package)?
...ry variable for trend, also allows different
intercepts for years as a random effect ? I hope):-
mtrend<-lmer(a_dataframe$mean_ind~index+sin(time*2*pi)+cos(time*2*pi)+(1|factor(a_dataframe$YEAR)),method="ML")
using ?lm? I followed the following process to produce the graph I wanted.
lmodel<-with(a_dataframe,lm(mean_ind~sin(time*2*pi)+cos(time*2*pi)))
plot(time,a_dataframe$mean_ind,pch=".")
lines(time,predict(lmodel))
How can I do the same with lmer? I have tried a variety of things with
?predict?, trying to put the results from lmer as a ?groupedData? object
etc. But I...