Hi,
I'm trying to fit nonlinear mixed effects model using nlme function but
getting an error message. Here is what I have:
fitted_model = nlme(scores~spline(b1,b2,b3,kt,time),
fixed = list(b1~1, b2~1, b3~1, kt~1),
random = b1+b2+b3~1,
groups= ~id,
data = sdat,
start = c(b1=3.5,b2=2,b3=.60,kt=3.5),verbose=T)
Error:
Error in spline(b1, b2, b3, kt, time) : invalid interpolation method
In addition: Warning message:
In if (is.na(method)) stop("invalid interpolation method") :
the condition has length > 1 and only the first element will be used
Any help will be highly appreciated
Victor
[[alternative HTML version deleted]]
I never had seen spline() inside some nls()/nlme() function. Are you sure that this fit is possible? Splines makes a lot or successive local polynomial fits, so they need a lot of parameters. I don't think that is possible a good spline fit with only four parameters. In this case you could use loess() or locfit() in locfit library. Walmes - Brasil. ----- ..oooO .................................................................................................. ..(....)... 0ooo... Walmes Zeviani ...\..(.....(.....)... Master in Statistics and Agricultural Experimentation ....\_)..... )../.... walmeszeviani at hotmail.com, Lavras - MG, Brasil ............ (_/............................................................................................ -- View this message in context: http://n4.nabble.com/HELP-on-Non-Linera-Mixed-Effect-model-tp1556953p1557173.html Sent from the R help mailing list archive at Nabble.com.
vaibhav dua wrote:> > Hi, > > I'm trying to fit nonlinear mixed effects model using nlme function but > getting an error message. Here is what I have: > > fitted_model = nlme(scores~spline(b1,b2,b3,kt,time), > fixed = list(b1~1, b2~1, b3~1, kt~1), > random = b1+b2+b3~1, > groups= ~id, > data = sdat, > start = c(b1=3.5,b2=2,b3=.60,kt=3.5),verbose=T) >Use package nlmeSplines for this. Dieter -- View this message in context: http://n4.nabble.com/HELP-on-Non-Linera-Mixed-Effect-model-tp1556953p1557223.html Sent from the R help mailing list archive at Nabble.com.