snm | R Documentation |
This generic function fits a semi-paramteric nonlinear mixed-effects model in the formulation described in Ke and Wang (2001). Current version only allows linear dependence on non-parametric functions.
snm(formula, func, data=list(), fixed, random=fixed,
groups, start, spar="v", verbose=FALSE, method="REML", control=NULL,
correlation=NULL, weights=NULL)
formula |
a formula object, with the response on the left of a ~ operator, and an expression of variables, parameters and non-parametric functions on the right. |
func |
a list of spline formulae each specifying the spline components necessary to
estimate each non-parametric function. On the left of a |
fixed |
a two-sided formula specifying models for the fixed effects.
The syntax of |
start |
a numeric vector, the same length as the number of fixed effects, supplying starting values for the fixed effects. |
spar |
a character string specifying a method for choosing the smoothing parameter. "v", "m" and "u" represent GCV, GML and UBR respectively. Default is "v" for GCV. |
data |
An optional data frame containing the variables appearing in |
random |
an optional random effects structure specifying models for the random effects.
The same syntax of |
groups |
an optional one-sided formula of the form ~g1 (single level) or ~g1/.../gQ (multiple levels of nesting), specifying the partitions of the data over which the random effects vary. g1,...,gQ must evaluate to factors in data. See nlme for details. |
verbose |
an optional logical numerical value. If |
method |
a character string. If 'REML' the model is fit by maximizing the restricted log-likelihood. If 'ML' the log-likelihood is maximized. Default is 'REML. |
control |
a list of parameters to control the performance of the algorithm. |
correlation |
an optional |
weights |
an optional |
an object of class snm
is returned, representing a semi-parametric nonlinear
mixed effects model fit. Generic functions such as print, summary, predict and
intervals have methods to show the results of the fit.
Chunlei Ke chunlei_ke@yahoo.com and Yuedong Wang yuedong@pstat.ucsb.edu.
Ke, C. and Wang, Y. (2001). Semi-parametric Nonlinear Mixed Effects Models and Their Applications. JASA 96:1272-1298.
Pinheiro, J.C. and Bates, D. M. (2000). Mixed-Effects Models in S and S-PLUS. Springer.
predict.snm
, intervals.snm
, snm.control
,
print.snm
,summary.snm
## Not run:
data(CO2)
options(contrasts=rep("contr.treatment", 2))
co2.fit1 <- nlme(uptake~exp(a1)*(1-exp(-exp(a2)*(conc-a3))),
fixed=list(a1+a2~Type*Treatment,a3~1),
random=a1~1, groups=~Plant,
start=c(log(30),0,0,0,log(0.01),0,0,0,50),
data=CO2)
M <- model.matrix(~Type*Treatment, data=CO2)[,-1]
co2.fit2 <- snm(uptake~exp(a1)*f(exp(a2)*(conc-a3)),
func=f(u)~list(~I(1-exp(-u))-1,lspline(u, type="exp")),
fixed=list(a1~M-1,a3~1,a2~Type*Treatment),
random=list(a1~1), group=~Plant, verbose=TRUE,
start=co2.fit1$coe$fixed[c(2:4,9,5:8)], data=CO2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.