MeasError: Create a Measurement Error Object

Description Usage Arguments Value Author(s) Examples

View source: R/MeasError.R

Description

This function creates a measurement error object, usually used as a covariate or the outcome in the formula argument of mecor if one wants to correct for the measurement error in that variable using a reference variable or a replicate measure.

Usage

1
MeasError(substitute, reference, replicate, differential)

Arguments

substitute

a vector containing the error-prone measure

reference

a vector containing the reference measure assumed without measurement error

replicate

a vector or matrix with replicates of the error-prone measure with classical measurement error. This can either be replicates obtained by using the same measurement method as the substitute measure (replicates study) or replicates using a different measurement method than the substitute measure (calibration study).

differential

a vector containing the variable to which the measurement error is differential.

Value

MeasError returns an object of class "MeasError".

An object of class MeasError is a list containing the substitute and reference (and replicate or differential if applicable) variables and has attributes input (the name of the substitute and reference or replicate and differential (if applicable) variables) and call (the matched call).

Author(s)

Linda Nab, l.nab@lumc.nl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## measurement error in a covariate:
# internal covariate-validation study
data(vat)
with (vat, MeasError(substitute = wc,
                     reference = vat))
# replicates study
data(bloodpressure)
with (bloodpressure, MeasError(substitute = sbp30,
                               replicate = cbind(sbp60, sbp120)))
# outcome-calibration study
data(sodium)
with(sodium, MeasError(substitute = recall,
                       replicate = cbind(urinary1, urinary2)))
## measurement error in the outcome:
# internal outcome-validation study
data(haemoglobin)
with(haemoglobin, MeasError(substitute = capillary,
                            reference = venous))
# internal outcome- validation study with differential measurement error in
# the dependent variable
data(haemoglobin)
with(haemoglobin, MeasError(substitute = capillary,
                            reference = venous,
                            differential = supplement))

LindaNab/mecor documentation built on Dec. 15, 2021, 6:59 p.m.