MeasError {mecor} | R Documentation |
Create a Measurement Error Object
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
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
## 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))