vcov.regmedint: Extract variance estimates in the vcov form.

View source: R/08_regmedint_class_user_methods.R

vcov.regmedintR Documentation

Extract variance estimates in the vcov form.

Description

Extract variance estimates evaluated at a0, a1, m_cde, and c_cond.

Usage

## S3 method for class 'regmedint'
vcov(object, a0 = NULL, a1 = NULL, m_cde = NULL, c_cond = NULL, ...)

Arguments

object

An object of the regmedint class.

a0

A numeric vector of length 1

a1

A numeric vector of length 1

m_cde

A numeric vector of length 1 The mediator value at which the controlled direct effect (CDE) conditional on the adjustment covariates is evaluated. If not provided, the default value supplied to the call to regmedint will be used. Only the CDE is affected.

c_cond

A numeric vector of the same length as cvar. A set of covariate values at which the conditional natural effects are evaluated.

...

For compatibility with the generic. Ignored.

Value

A numeric matrix with the diagonals populated with variance estimates. Off-diagnonals are NA since these are not estimated.

Examples

library(regmedint)
data(vv2015)
regmedint_obj <- regmedint(data = vv2015,
                           ## Variables
                           yvar = "y",
                           avar = "x",
                           mvar = "m",
                           cvar = c("c"),
                           eventvar = "event",
                           ## Values at which effects are evaluated
                           a0 = 0,
                           a1 = 1,
                           m_cde = 1,
                           c_cond = 0.5,
                           ## Model types
                           mreg = "logistic",
                           yreg = "survAFT_weibull",
                           ## Additional specification
                           interaction = TRUE,
                           casecontrol = FALSE)
vcov(regmedint_obj)
## Evaluate at different values
vcov(regmedint_obj, m_cde = 0, c_cond = 1)


regmedint documentation built on April 7, 2022, 1:17 a.m.