View source: R/sensitivityparametersM.R
| sensitivityparametersM | R Documentation |
sensitivityparametersM() returns a list with the sensitivity parameters
and an indicator if bias is negative and the treatment coding is reversed
for an assumed model.
sensitivityparametersM(
whichEst,
whichBound,
Vval,
Uval,
Tcoef,
Ycoef,
Scoef,
Mmodel,
pY1_T1_S1,
pY1_T0_S1
)
whichEst |
Input string. Defining the causal estimand of interest.
Available options are as follows. (1) Risk ratio in the total
population: |
whichBound |
Input string. Defining the bound of interest.
Available options are as follows. (1) SV bound: |
Vval |
Input matrix. The first column is the values of the categories of V. The second column is the probabilities of the categories of V. If V is continuous, use a fine grid of values and probabilities. |
Uval |
Input matrix. The first column is the values of the categories of U. The second column is the probabilities of the categories of U. If U is continuous, use a fine grid of values and probabilities. |
Tcoef |
Input vector. Two numerical elements. The first element is the intercept in the model for the treatment. The second element is the slope in the model for the treatment. |
Ycoef |
Input vector. Three numerical elements. The first element is the intercept in the model for the outcome. The second element is the slope for T in the model for the outcome. The third element is the slope for U in the model for the outcome. |
Scoef |
Input matrix. Numerical matrix of size K by 4, where K is the number of selection variables. Each row is the coefficients for one selection variable. The first column is the intercepts in the models for the selection variables. The second column is the slopes for V in the models for the selection variables. The third column is the slopes for U in the models for the selection variables. The fourth column is the slopes for T in the models for the selection variables. |
Mmodel |
Input string. Defining the models for the variables in the M
structure. If |
pY1_T1_S1 |
Input scalar. The observed probability P(Y=1|T=1,I_S=1). |
pY1_T0_S1 |
Input scalar. The observed probability P(Y=1|T=0,I_S=1). used. |
A list containing the sensitivity parameters.
Smith, Louisa H., and Tyler J. VanderWeele. "Bounding bias due to selection." Epidemiology (Cambridge, Mass.) 30.4 (2019): 509.
Zetterstrom S, Sjölander A, Waernbaum I. "Investigations of sharp bounds for causal effects under selection bias." Statistical Methods in Medical Research. 2025.
Zetterstrom, Stina and Waernbaum, Ingeborg. "Selection bias and multiple inclusion criteria in observational studies" Epidemiologic Methods 11, no. 1 (2022): 20220108.
Zetterstrom, Stina. "Bounds for selection bias using outcome probabilities" Epidemiologic Methods 13, no. 1 (2024): 20230033
# Example with no selection bias.
V = matrix(c(1, 0, 0.1, 0.9), ncol = 2)
U = matrix(c(1, 0, 0.1, 0.9), ncol = 2)
Tr = c(0, 1)
Y = c(0, 0, 1)
S = matrix(c(1, 0, 0, 0, 1, 0, 0, 0), nrow = 2, byrow = TRUE)
probT1 = 0.534
probT0 = 0.534
sensitivityparametersM(whichEst = "RR_tot", whichBound = "SV", Vval = V,
Uval = U, Tcoef = Tr, Ycoef = Y, Scoef = S, Mmodel = "P",
pY1_T1_S1 = probT1, pY1_T0_S1 = probT0)
sensitivityparametersM(whichEst = "RR_tot", whichBound = "GAF", Vval = V,
Uval = U, Tcoef = Tr, Ycoef = Y, Scoef = S, Mmodel = "P",
pY1_T1_S1 = probT1, pY1_T0_S1 = probT0)
# Example with selection bias. DGP from the zika example.
V = matrix(c(1, 0, 0.85, 0.15), ncol = 2)
U = matrix(c(1, 0, 0.5, 0.5), ncol = 2)
Tr = c(-6.2, 1.75)
Y = c(-5.2, 5.0, -1.0)
S = matrix(c(1.2, 2.2, 0.0, 0.5, 2.0, -2.75, -4.0, 0.0), ncol = 4)
probT1 = 0.286
probT0 = 0.004
sensitivityparametersM(whichEst = "RR_sub", whichBound = "SV", Vval = V,
Uval = U, Tcoef = Tr, Ycoef = Y, Scoef = S, Mmodel = "L",
pY1_T1_S1 = probT1, pY1_T0_S1 = probT0)
sensitivityparametersM(whichEst = "RR_sub", whichBound = "GAF", Vval = V,
Uval = U, Tcoef = Tr, Ycoef = Y, Scoef = S, Mmodel = "L",
pY1_T1_S1 = probT1, pY1_T0_S1 = probT0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.