Learn R Programming

doseSens (version 1.0.0)

dev_TV: Computes deviation from uniform distribution in total variation distance for a given amount of unmeasured confounding and a greater than alternative with a binary outcome.

Description

Computes deviation from uniform distribution in total variation distance for a given amount of unmeasured confounding and a greater than alternative with a binary outcome.

Usage

dev_TV(Z, Q, index, gamma, direct = "upper")

Value

A vector of length equaling the number of matched sets consisting of the TV distance from the uniform for each matched set at gamma level of unmeasured confounding for the worst-case.

Arguments

Z

A length N vector of (nonnegative) observed doses.

Q

A length N vector of observed binary outcomes.

index

A length N vector of indices indicating matched set membership.

gamma

The nonnegative sensitivity parameter; gamma = 0 means no unmeasured confounding.

direct

The direction of the test - "upper" or "lower"; default is upper.

Examples

Run this code
# Load the data
data <- lead_crime
# compute total variation distances.
total_variation <- dev_TV(data$log_lead, data$complain,
data$matched_sets, gamma = log(1.5))

Run the code above in your browser using DataLab