Learn R Programming

JMbayes2 (version 0.6-0)

variogram: Variogram for Longitudinal Data

Description

It computes the semi-variogram for longitudinal data.

Usage

variogram(y, times, id)

Value

A list with two components, i.e., svar, a two-column matrix with the time lags and the variogram values, and sigma2 the total variance.

Arguments

y

a numeric vector of longitudinal responses.

times

a numeric vector of times at which the longitudinal responses were collected.

id

a numeric vector of a factor of subject id numbers.

Author

Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl

Examples

Run this code
ind <- aids$patient == 2
yy <- aids$CD4[ind]
tt <- aids$obstime[ind]
ids <- aids$patient[ind]
variogram(yy, tt, ids)

Run the code above in your browser using DataLab