next up previous
Next: Non-Parametric Nonlinear Regression Models Up: Semi-parametric Linear Mixed-Effects Models Previous: Model and Estimation

The slm Function

The S function for fitting a SLM is slm. A typical call is

    slm(formula, rk, random, data)
The first three arguments are required. formula and rk serve the same purposes as in ssr. formula, a two-sided formula separated by the operator ~, lists the response variable on the left side, and the bases $\phi_1(t), \cdots, \phi_M(t)$ of ${\cal H}_0$ and covariates for the fixed effects in $X$ on the right side. rk specifies the reproducing kernels of ${\cal H}_1,\cdots,{\cal H}_p$. random specifies the random effects the same way as in nlme. The syntax of random is in the form of a named list of formulae or some pdMat objects. See the help file of lme for more details.

Other options include correlation, weights and control. They all have the same functions as in ssr.

An object of slm class is returned. Generic functions summary, predict and intervals can be applied to extract further information. The predict function returns predictions at specified points. The intervals function returns the posterior means and variances of combinations of components in $f$ as an object of class "bCI". Then the generic function plot can be used to construct plots. See help files for details.

As a simple example, consider repeated measures over time from multiple subjects. Suppose that we want to fit the following model

\begin{eqnarray*}
y_{ij} = f(t_{ij})+b_i + \epsilon_{ij},~~~~i=1,\cdots,m;~~
j=1,\cdots,n_i;~~t_{ij}\in [0,1],
\end{eqnarray*}

where $y_{ij}$ is the response at time $t_{ij}$ from subject $i$, $f\in W_2([0,1])$, $b_i$ is a random intercept for subject $i$ and $b_i \stackrel{iid}{\sim} \mbox{N}(0,\sigma_1^2)$, and $\epsilon_{ij}$'s are random errors independent of $b_i$'s. Suppose that random errors are independent between subjects, but correlated within a subject with a Gaussian correlation structure. Then we can fit such a model with
    slm(y~t, rk=cubic(t), random=list(subject=~1), 
        corr=corGaus(form=~t|subject))


next up previous
Next: Non-Parametric Nonlinear Regression Models Up: Semi-parametric Linear Mixed-Effects Models Previous: Model and Estimation
Yuedong Wang 2004-05-19