DAPSWeightCE: Plot the effect estimate as a function of w.

Description Usage Arguments Examples

View source: R/Weight_balance_functions.R

Description

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.

Usage

1
2
DAPSWeightCE(dataset, out.col = NULL, trt.col = NULL, weights, pairs,
  chosen_w, main_title = NULL)

Arguments

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().

Examples

 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

gpapadog/DAPSm documentation built on May 17, 2019, 8 a.m.