max_lambda {TheSFACE} | R Documentation |
Max lambda1 and lambda2 values
Description
In order to perform the sensitivity analysis, the researcher must choose which values of lambda1 and lambda2 to explore. We give here an upper limit for lambda1 and lambda2, estimated from the data.
Usage
max_lambda(stand_formula, exposure, df, weight = 1)
Arguments
stand_formula |
A formula for standartization and DR, y ~ A + X, the outcome as a function of the exposure and covariates |
exposure |
The treatment/exposure vector pf length n. Must be encoded 1 for treated and 0 for untreated. |
df |
a data frame with columns for the outcome, exposure and covariates. |
weight |
A numerical vector of length n, holding weights to adjust for missing subtyps, Default: 1 |
Value
a vector of two numeric values, the first element is the maximum possible lambda1 value and the second element is the maximum possible lambda2 value.
See Also
Examples
A <- rbinom(n = 1000, size = 1, prob = 0.5)
X1 <- rbinom(n = 1000, size = 1, prob = 0.5)
X2 <- rnorm(n = 1000, mean = 0, sd = 1)
y <- sample(c(0,1,2), 1000, replace=TRUE, prob=c(0.8, 0.1, 0.1) )
weight <- rep(1, n = 1000)
df <- data.frame(y, A, X1, X2, weight)
max_lambda(stand_formula = y ~ A + X1 + X2,
exposure = "A",
df = df,
weight = weight)
[Package TheSFACE version 0.1.0 Index]