Learn R Programming

COMMA

COMMA: COrrecting Misclassified Mediation Analysis

Overview

COMMA provides a set of functions for the analysis of mediation models with binary mediator misclassification.

The two main parts are:

  • Classification probability calculations
  • Parameter estimation

Classification probability calculations

The package allows users to compute the probability of the latent true mediators and the conditional probability of observing a mediator value given the latent true mediator, based on parameters estimated from the COMMA_EM, COMMA_PVW, and COMMA_OLS functions.

Parameter estimation

Jointly estimate parameters from the true mediator, observed mediator, and outcome mechanisms, respectively, in a mediation analysis with a binary misclassified mediator variable. Three methods are provided for parameter estimation: an ordinary least squares correction procedure, a predictive value weighting approach, and an expectation-maximization algorithm.

Installation

# Install from CRAN:
install.packages("COMBO")

# Install the development version from GitHub:
# install.packages("devtools")
devtools::install_github("kimberlywebb/COMMA")

Copy Link

Version

Install

install.packages('COMMA')

Monthly Downloads

173

Version

1.1.1

License

MIT + file LICENSE

Maintainer

Kimberly Hochstedler

Last Published

December 13th, 2024

Functions in COMMA (1.1.1)

COMBO_EM_function

EM-Algorithm Function for Estimation of the Misclassification Model
COMBO_EM_algorithm

EM-Algorithm Estimation of the Binary Outcome Misclassification Model
EM_function_bernoulliY_XM

EM Algorithm Function for Estimation of the Misclassification Model
EM_function_poissonY_XM

EM Algorithm Function for Estimation of the Misclassification Model
COMMA_data

Generate Data to use in COMMA Functions
EM_function_normalY

EM Algorithm Function for Estimation of the Misclassification Model
EM_function_normalY_XM

EM Algorithm Function for Estimation of the Misclassification Model
EM_function_poissonY

EM Algorithm Function for Estimation of the Misclassification Model
NCHS2022_sample

Example data from the National Vital Statistics System of the National Center for Health Statistics (NCHS), 2022
EM_function_bernoulliY

EM Algorithm Function for Estimation of the Misclassification Model
pi_compute

Compute Probability of Each True Outcome, for Every Subject
misclassification_prob

Compute Conditional Probability of Observed Mediator Given True Mediator, for Every Subject
w_m_poissonY

Compute E-step for Binary Mediator Misclassification Model Estimated With the EM Algorithm
true_classification_prob

Compute Probability of Each True Mediator, for Every Subject
theta_optim_XM

Likelihood Function for Normal Outcome Mechanism with a Binary Mediator and an Interaction Term
theta_optim

Likelihood Function for Normal Outcome Mechanism with a Binary Mediator
sum_every_n1

Sum Every "n"th Element, then add 1
w_m_normalY

Compute E-step for Binary Mediator Misclassification Model Estimated With the EM Algorithm
w_m_binaryY

Compute E-step for Binary Mediator Misclassification Model Estimated With the EM Algorithm
sum_every_n

Sum Every "n"th Element
pistar_compute

Compute Conditional Probability of Each Observed Outcome Given Each True Outcome, for Every Subject
COMMA_PVW_bootstrap_SE

Estimate Bootstrap Standard Errors using PVW
COMMA_PVW

Predictive Value Weighting Estimation of the Binary Mediator Misclassification Model
COMMA_boot_sample

Generate Bootstrap Samples for Estimating Standard Errors
COMBO_weight

Compute E-step for Binary Outcome Misclassification Model Estimated With the EM-Algorithm
COMMA_OLS_bootstrap_SE

Estimate Bootstrap Standard Errors using OLS
COMMA_EM

EM Algorithm Estimation of the Binary Mediator Misclassification Model
COMMA_EM_bootstrap_SE

Estimate Bootstrap Standard Errors using EM
COMMA_OLS

Ordinary Least Squares Estimation of the Binary Mediator Misclassification Model