# estimate fixed parameters use data object posneg.data
data(posneg.data)
modpar(posneg.data$age, posneg.data$mass, pn.options = "myoptions")
# estimate fixed parameters use data object posneg.data (only first
# 4 group levels for example's sake) and specify a fixed hatching
# mass for curve optimization using \code{\link{SSposnegRichards}}
modpar(posneg.data$age, posneg.data$mass, pn.options = "myoptions")
subdata <- subset(posneg.data,posneg.data$id == as.character(36)
| posneg.data$id == as.character(9)
| posneg.data$id == as.character(32)
| posneg.data$id == as.character(43))
richardsR22.lis <- nlsList(mass ~ SSposnegRichards(age, Asym = Asym,
K = K, Infl = Infl, RAsym = RAsym, Rk = Rk, Ri = Ri,
modno = 22, pn.options = "myoptions"), data = subdata)
# fit a two component model - enter your own data in place of "mydata"
\dontrun{
modpar(mydata$x,mydata$y,twocomponent.x=TRUE, pn.options = "myoptions") # if x of intersection unknown
modpar(mydata$x,mydata$y,twocomponent.x=75, pn.options = "myoptions") # if x of intersection = 75
richardsR1.nls <- nls(y~ SSposnegRichards(x, Asym = Asym, K = K,
Infl = Infl, M = M, RAsym = RAsym, Rk = Rk, Ri = Ri, RM = RM, modno = 1, pn.options = "myoptions")
, data = mydata)
}
# force an 8 parameter estimate on logistic data
data(logist.data)
modpar(logist.data$age,logist.data$mass,force8par=TRUE, pn.options = "myoptions")
# force an 4 parameter model on logistic data
data(logist.data)
modpar(logist.data$age,logist.data$mass,force4par=TRUE, pn.options = "myoptions")
# troubleshoot the fit of a model
data(posneg.data)
modpar(posneg.data$age,posneg.data$mass,verbose=TRUE, pn.options = "myoptions")
Run the code above in your browser using DataLab