Learn R Programming

joineR (version 1.0-2)

plot.vargm: Plots the empirical variogram for longitudinal data

Description

Plots the empirical variogram for observed measurements, of an object of class 'vargm', obtained by using function variogram.

Usage

## S3 method for class 'vargm':
plot(x, smooth = FALSE, bdw = NULL, follow.time = NULL, points = TRUE, \dots)

Arguments

x
object of class vargm obtained by using function variogram
smooth
Logical value to use a non-parametric estimator to calculate the variogram of all $v_{ijk}$. The default is FALSE, as it uses time averages
bdw
bandwidth to use in the time averages. The default is NULL, because this is calculated automatically.
follow.time
the interval of time we want to construct the variogram for. When NULL this is the maximum of the data
points
Logical value if the points $v_{ijk}$ should be plotted
...
other graphical options as in par

Value

  • The function returns a graphical device with the plot of empirical variogram

Examples

Run this code
data(mental)
mental.unbalanced <- to.unbalanced(mental, id.col = 1, 
                                   times = c(0,1,2,4,6,8),
                                   Y.col = 2:7, 
                                   other.col = c(8,10,11))
names(mental.unbalanced)[3] <- "Y"
vgm <- variogram(indv = mental.unbalanced[, 1],
                 time = mental.unbalanced[, 2],
                 Y = mental.unbalanced[, 3])
plot(vgm, ylim = c(0, 500))

Run the code above in your browser using DataLab