[R-sig-ME] one question about "loess"

Zhong, Xiao xiaozh at WPI.EDU
Wed Feb 20 18:54:01 CET 2008

Dear all,

I tried to use "loess" to fit some longitudinal data as:

loess.fit<-by(mcas5.square.one.knot,mcas5.square.one.knot$skills,function(x) loess(response~month_elapsed,data=x,span=1,degree=1))

Then I tried to draw the loess fitting lines for each "skill". But for the FIRST "skill", I got the following error message as:

> time<-(260:800)/100
> xx<-seq(min(time),max(time),0.1)
> yy<-predict(loess.fit[[1]],data.frame(time=xx))
Error in predict(loess.fit[[1]], data.frame(time = xx)) :
        no applicable method for "predict"
> yy2<-predict(loess.fit.qua[[1]],data.frame(time=xx))
Error in predict(loess.fit.qua[[1]], data.frame(time = xx)) :
        no applicable method for "predict"

Actually, I can still get the loess curve corresponding to this skill, but I don't know if I can trust it... Could any of you please give me a clue of what's the problem of my code?

Thanks very much,


From: r-sig-mixed-models-bounces at r-project.org [r-sig-mixed-models-bounces at r-project.org] On Behalf Of demont at access.uzh.ch [demont at access.uzh.ch]
Sent: Tuesday, February 19, 2008 10:01 AM
To: r-sig-mixed-models at r-project.org
Subject: [R-sig-ME] How to “weight” measurements (family means)?

Dear all,

I have recently started working with the lme4 package and its lmer function.
My data file is based on family means. I do not have the row data for the
individuals but I do know for every family on how many individuals the
family means are based (i.e. how many individuals per family I have
How can I fit a mixed-effects model to this data with lmer so that my family
means are weighted with an appropriate weighting factor (i.e. weights my
family means according to the number of offspring per family measured for
this family = more weight for family means that are based upon many
individuals, because I have more confidence in this measurements)?? Does
this involve using the optional vector “weights”??
Despite going through the reference manual, the vignettes and the
R-sig-mixed-models archives I did not find a clear answer to this very
fundamental problem and would hence be deeply grateful for a specific and
detailed answer!


Marco Demont
Zoological Museum
University of Zuerich
Winterthurerstrasse 190
CH-8057 Zuerich

Tel.: +41 44 635 47 79
demont at access.uzh.ch
demont at gmx.ch

R-sig-mixed-models at r-project.org mailing list

More information about the R-sig-mixed-models mailing list