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

slm(formula, rk, random, data)The first three arguments are required.

`~`

, lists the response variable on the left side,
and the bases
of and
covariates for the fixed effects in on the right
side.
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 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

where is the response at time from subject , , is a random intercept for subject and , and 's are random errors independent of '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))