dev_TV {doseSens} | R Documentation |
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")
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. |
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.
Examples
# Load the data
data <- treat_out_match
# compute total variation distances.
total_variation <- dev_TV(data$treat, data$complain,
data$match_ind, gamma = log(1.5))
[Package doseSens version 0.1.0 Index]