Skip to contents

adjust_om returns the exposure-outcome odds ratio and confidence interval, adjusted for outcome misclassificaiton.

Usage

adjust_om(
  data_observed,
  data_validation = NULL,
  y_model_coefs = NULL,
  level = 0.95
)

Arguments

data_observed

Object of class data_observed corresponding to the data to perform bias analysis on.

data_validation

Object of class data_validation corresponding to the validation data used to adjust for bias in the observed data. Here, the validation data should have data for the same variables as in the observed data, plus data for the true and misclassified outcome corresponding to the observed outcome in data_observed.

y_model_coefs

The regression coefficients corresponding to the model: logit(P(Y=1)) = δ0 + δ1X + δ2Y* + δ2+jCj, where Y represents the binary true outcome, X is the exposure, Y* is the binary misclassified outcome, C represents the vector of measured confounders (if any), and j corresponds to the number of measured confounders. The number of parameters is therefore 3 + j.

level

Value from 0-1 representing the full range of the confidence interval. Default is 0.95.

Value

A list where the first item is the odds ratio estimate of the effect of the exposure on the outcome and the second item is the confidence interval as the vector: (lower bound, upper bound).

Details

Bias adjustment can be performed by inputting either a validation dataset or the necessary bias parameters. Values for the bias parameters can be applied as fixed values or as single draws from a probability distribution (ex: rnorm(1, mean = 2, sd = 1)). The latter has the advantage of allowing the researcher to capture the uncertainty in the bias parameter estimates. To incorporate this uncertainty in the estimate and confidence interval, this function should be run in loop across bootstrap samples of the dataframe for analysis. The estimate and confidence interval would then be obtained from the median and quantiles of the distribution of odds ratio estimates.

Examples

df_observed <- data_observed(
  data = df_om,
  exposure = "X",
  outcome = "Ystar",
  confounders = "C1"
)
# Using validation data -----------------------------------------------------
df_validation <- data_validation(
  data = df_om_source,
  true_exposure = "X",
  true_outcome = "Y",
  confounders = "C1",
  misclassified_outcome = "Ystar"
)

adjust_om(
  data_observed = df_observed,
  data_validation = df_validation
)
#> $estimate
#> [1] 2.049938
#> 
#> $ci
#> [1] 1.970771 2.132285
#> 

# Using y_model_coefs -------------------------------------------------------
adjust_om(
  data_observed = df_observed,
  y_model_coefs = c(-3.1, 0.6, 1.6, 0.4)
)
#> $estimate
#> [1] 1.981582
#> 
#> $ci
#> [1] 1.904591 2.061686
#>