Description Usage Arguments Value Author(s) References Examples

Calculates empirical variogram for data sets with regularly or irregularly spaced time points, and plots the result

1 2 |

`resid` |
a vector of empirical residuals |

`timeVar` |
a vector for the time variable |

`id` |
a vector for subject identification |

`binwidth` |
a numerical value for the bin length, to be used for irregularly spaced data |

`numElems` |
a numerical value for the elimination of the bins with less than that number of elements |

`inc.var` |
a character string, if set |

`irregular` |
a character string, |

Returns mid values and means of the bins, and numbers of elements falling into the bins for `irregular = TRUE`

,
and lags and means of the lags, and number of the elements for the lags for `irregular = FALSE`

.
Process variance is also returned.

Ozgur Asar, Peter J. Diggle

Asar O, Ritchie J, Kalra P, Diggle PJ (2015) Acute kidney injury amongst chronic kidney disease patients: a case-study in statistical modelling. To be submitted.

Diggle PJ (1988) An approach to the analysis of repeated measurements. *Biometrics*, **44**, 959-971.

Diggle PJ, Heagerty PJ, Liang K-Y, Zeger SL. (2002) *Analysis of Longitudinal Data, 2nd edition*.
Oxford University Press: Oxford.

Diggle PJ, Ribeiro PJ Jr. (2007) *Model-based Geostatistics*. Springer-Verlag: New York.

Diggle PJ, Sousa I, Asar O (2015) Real time monitoring of progression towards renal failure in primary care patients.
*Biostatistics*, 16(3), 522-536.

1 2 3 4 5 6 7 8 9 10 | ```
# loading the data set and subsetting it for the first 20 patients
# for the sake illustration of the usage of the functions
data(data.sim.ibm)
data.sim.ibm.short <- data.sim.ibm[data.sim.ibm$id <= 20, ]
# obtaining empirical residuals by a linear model
# and calculating the empirical variogram
lm.fit <- lm(log.egfr ~ sex + bage + fu + pwl, data = data.sim.ibm.short)
variogram(resid = resid(lm.fit), timeVar = data.sim.ibm.short$fu, id = data.sim.ibm.short$id,
binwidth = 0.1, numElems = 20, inc.var = FALSE)
``` |

lmenssp documentation built on May 29, 2017, 10:33 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.