# slim: Fit Singular Linear Models In slim: Singular Linear Models for Longitudinal Data

## Description

Fit a singular linear model to longitudinal data.

## Usage

 ```1 2``` ```slim(formula, data, covariance = "randomwalk", limit = ~1, contrasts = NULL) ```

## Arguments

 `formula` a model formula for the fixed effects `data` a 'data.table' with two keys, respectively identifying subjects and observation times `covariance` an R object for which a 'list_covariances' method exists. Options include a character string such as "identity", "randomwalk" (the default), "brownian" or "pascal"; a list of covariance matrices; a function to be used in 'outer' and applied to the observation times; or a 'jmcmMod' or 'lmerMod' model fit. `limit` a one-sided model formula for the (thin) Cholesky factor of the limiting covariance matrix (default ~ 1, so the limiting covariance matrix is the matrix of ones) `contrasts` an optional list. See the 'contrasts.arg' argument of 'model.matrix.default'.

## Value

an object of class 'slim'

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17``` ```slim_fit <- slim(renalfn ~ group + month, dialysis) summary(slim_fit) if(require("lme4")) { lmer_fit <- lmer(renalfn ~ group + month + (1 + month | id), dialysis) slim_fit <- slim(renalfn ~ 1 + group + month, dialysis, covariance = lmer_fit) summary(slim_fit) summary(slim_fit, empirical = FALSE) } if(require("jmcm")) { jmcm_fit <- jmcm(renalfn | id | month ~ group | 1, dialysis, triple = rep(2L, 3), cov.method = "mcd") slim_fit <- slim(renalfn ~ group + month, dialysis, covariance = jmcm_fit) summary(slim_fit) summary(slim_fit, empirical = FALSE) } ```

slim documentation built on May 2, 2019, 7:04 a.m.