mercVal: mercVal

View source: R/mercVal.R

mercValR Documentation

mercVal

Description

This function corrects for measurement error in exposure or exposure and covariates and gives corrected coefficients associated standard errors, p values as well as variance-covariance matrix of corrected coefficients. Users can choose to either use built-in outcome model where only linear and generalized linear model is currently supported under both internal and external validation study design, or supply their own coefficients and variance-covariance matrix from outcome models such as logistic model or Cox models under external validation study design. A validation study is required to empirically characterize the measurement error calibration model. Options are given for main study/external validation study design and main study/internal validation study design (not an option when users supply their own uncorrected estimates) (Spiegelman, Carrol, Kipnis; 2001). More technical details are given in Rosner et al (1989), Rosner et al (1990) and Spiegelman et al (1997).

Usage

mercVal(
  supplyEstimates = FALSE,
  ms,
  vs,
  sur,
  exp,
  covCalib = NULL,
  covOutcome = NULL,
  outcome = NA,
  method = "lm",
  family = NA,
  link = NA,
  external = TRUE,
  pointEstimates = NA,
  vcovEstimates = NA
)

Arguments

supplyEstimates

Indicates whether uncorrected estimates will be supplied by the user. If supplied by the user, then 'ms' is optional. Standard regression results will not be returned if TRUE.

ms

The input main study data set as dataframe. This dataframe should minimally include variables specified in 'sur', 'covCalib' and 'covOutcome' (if any).

vs

The input internal/external validation data set as dataframe. This dataframe should minimally include variables indicated in 'exp', 'sur' and 'covCalib'.

sur

character vector of mismeasured exposure and covariates (i.e. surrogates) in the main study dataset.

exp

character vector of correctly measured exposure and covariates that has a one-to-one correspondence to those specified in 'sur' in validation dataset. Must have same length as 'sur'.

covCalib

character vector of names of correctly measured covariates to adjust for in calibration model and outcome model.

covOutcome

character vector of names of correctly measured risk factors (that are not associated with exposure or surrogate) for outcome in the main study data to adjust for in outcome model in additional to those specified in covCalib. Should not include any variable from 'covCalib'. Leave unspecified if no such risk factors.

outcome

Outcome variable.

method

Methods for modeling, currently only 'lm' or 'glm' methods are available. Required.

family

Supply family parameter to pass to glm function. Not a character. Required if method="glm".

link

Supply link parameter to pass to glm function. Should be character. Required if method="glm".

external

Indicates whether 'vs' is an external validation set. If external=FALSE, then vs must contain variable specified in 'outcome'. If external=FALSE, then user cannot supply uncorrected estimates, i.e. supplyEstimates=FALSE.

pointEstimates

A numeric vector of point estimates from uncorrected standard regression analysis. Intercept estimate must be removed. Must include names for each point estimates corresponding to the (transformed) names from 'covCalib' followed by 'covOutcome'. Must be supplied if supplyEstimates = TRUE.

vcovEstimates

A p by p Variance-covariance matrix estimates from uncorrected standard regression analysis. Intercept estimates must be removed. Must include column names (excluding intercept) for the estimates corresponding to the (transformed) names from 'covCalib' followed by 'covOutcome'. Must be supplied if supplyEstimates = TRUE.

Value

printable dataframe from standard regression results (when supplyEstimates==FALSE) as well as corrected results

Author(s)

Wenze Tang and Molin Wang

References

Rosner B, Willett WC, Spiegelman D "Correction of logistic relative risk estimates and confidence intervals for systematic withinperson measurement error". Statistics in Medicine 8: 1051-1069, 1989. Rosner B, Spiegelman D, Willett WC "Correction of logistic regression relative risk estimates and confidence intervals for measurement error: the case of multiple covariates measured with error". American Journal of Epidemiology 1990;132: 734-735. Spiegelman D, McDermott A, Rosner B "The many uses of the 'regression calibration' method for measurement error bias correction in nutritional epidemiology". American Journal of Clinical Nutrition, 1997; 65:1179S-1186S. Spiegelman D, Carroll RJ, Kipnis V "Efficient regression calibration for logistic regression in main study/internal validation study designs with an imperfect regerence instrument". Statistics in Medicine 2001;20:139-160.


vanessaxiaofan/merc documentation built on May 7, 2023, 6:17 p.m.