snm {assist}  R Documentation 
This generic function fits a semiparamteric nonlinear mixedeffects model in the formulation described in Ke and Wang (2001). Current version only allows linear dependence on nonparametric functions.
snm(formula, func, data=sys.parent(), 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 nonparametric functions on the right. 
func 
a list of spline formulae each specifying the spline components necessary to
estimate each nonparametric function. On the left of a ~ operator of each component
is the unknow function symbol(s) as well as its arguments, while the right side is a
list of two components nb , an optional oneside formula for representing the null
space's bases, and a required rk structure. nb and rk are similar to formula
and rk in ssr. A missing nb denotes an empty null space.

fixed 
a twosided formula specifying models for the fixed effects.
The syntax of fixed in nlme is adopted.

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 formula
, random , rk , correlation , weights . By default, the variables
are taken from the environment from which snm is called.

random 
an optional random effects structure specifying models for the random effects.
The same syntax of random in nlme is assumed.

groups 
an optional onesided 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 TRUE , information on
the evolution of the iterative algorithm is printed. Default is
FALSE .

method 
a character string. If 'REML' the model is fit by maximizing the restricted loglikelihood. If 'ML' the loglikelihood is maximized. Default is 'ML. 
control 
a list of parameters to control the performance of the algorithm. 
correlation 
an optional corStruct object describing the withingroup correlation
structure. See the documentation of corClasses for a description of the available corStruct classes.
Default is NULL, corresponding to no withinin group correlations.

weights 
an optional varFunc object or onesided formula describing the
withingroup heteroscedasticity structure. If given as a formula,
it is used as the argument to varFixed , corresponding to fixed variance weights.
See the documentation on varClasses for a description of the available varFunc
classes. Defaults to NULL, corresponding to homoscesdatic withingroup errors.

an object of class snm
is returned, representing a semiparametric 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). Semiparametric Nonlinear Mixed Effects Models and Their Applications. JASA 96:12721298.
Pinheiro, J.C. and Bates, D. M. (2000). MixedEffects Models in S and SPLUS. Springer.
nlme
, predict.snm
, intervals.snm
, snm.control
,
print.snm
,summary.snm
data(CO2) options(contrasts=rep("contr.treatment", 2)) co2.fit1 < nlme(uptake~exp(a1)*(1exp(exp(a2)*(conca3))), 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)*(conca3)), func=f(u)~list(~I(1exp(u))1,lspline(u, type="exp")), fixed=list(a1~M1,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)