cal_rv {CopSens}R Documentation

Calculate Robustness Value When Executing Worstcase Calibration

Description

Calculate Robustness Value When Executing Worstcase Calibration

Usage

cal_rv(
  y,
  tr,
  t1,
  t2,
  mu_y_dt = NULL,
  sigma_y_t = NULL,
  mu_u_dt = NULL,
  cov_u_t = NULL,
  nU = NULL,
  ...
)

Arguments

y

data.frame, matrix or vector. Gaussian outcome variable.

tr

data.frame. Treatment variables with rows corresponding to observations and columns to variables.

t1

data.frame. First treatment arms of interest. May contain a single or multiple treatments in rows.

t2

data.frame. Second treatment arms of interest, which has same number of row as t1.

mu_y_dt

an optional scalar or vector that contains naive estimates of treatment effects ignoring confounding.

sigma_y_t

an optional scalar of the standard deviation of outcome conditional on treatments.

mu_u_dt

an optional matrix of difference in conditional confounder means, E(U \mid t1) - E(U \mid t2), with latent variables in columns.

cov_u_t

an optional covariance matrix of confounders conditional on treatments.

nU

Number of latent confounders to consider.

...

further arguments passed to kEstimate, pca

Value

A numeric vector with elements being the robustness value or NA if the ignorance region doesn't contains 0 for each contrast of interest.

Examples


# load the example data #
y <- GaussianT_GaussianY$y
tr <- subset(GaussianT_GaussianY, select = -c(y))
# calculate robustness value #
cal_rv(y = y, tr = tr, t1 = tr[1:2,], t2 = tr[3:4,])


[Package CopSens version 0.1.0 Index]