Description Usage Arguments Examples
View source: R/Weight_balance_functions.R
Plotting the effect estimate from various fit of DAPSm for varying w. The chosen w will be the only red dot. A loess curve is fit to the effect estimates.
1 2 |
dataset |
The dataset that was supplied to CalcDAPSWeightBalance() for calculating balance. |
out.col |
The index of the outcome column if it is not named 'Y' in the dataset. |
trt.col |
The index of the treatment column if it is not named 'X'. |
weights |
The weights that we used to fit DAPSm. |
pairs |
A list where each element corresponds to a weight. Each element is a vector including the row indices of the dataset that are included in the matched dataset for each weight w. 2nd element of the list returned by CalcDAPSWeightBalance(). |
chosen_w |
The weight value that was chosen by DAPSchoiceModel(). |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(toyData)
toyData$prop.scores <- glm(Z ~ X1 + X2 + X3 + X4, family = binomial,
data = toyData)$fitted.values
bal <- CalcDAPSWeightBalance(toyData, weights = seq(0, 1, length.out = 30),
cov.cols = 6:9, trt.col = 1,
coords.columns = c(4, 5), caliper = 0.3,
matching_algorithm = 'greedy')
DAPS <- DAPSchoiceModel(toyData, trt.col = 1, balance = bal$balance,
cutoff = 0.15, pairs = bal$pairs,
weights = seq(0, 1, length.out = 30))
CE <- DAPSWeightCE(dataset = toyData, trt.col = 1,
weights = seq(0, 1, length.out = 30), pairs = x$pairs,
chosen_w = DAPS$weight)
CE$plot
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.