psweights: Propensity Score Weights

Description Usage Arguments Details Value Methods (by generic) References Examples

Description

Five different matching weights based on an exposure and propensity score.

Usage

1
2
3
4
5
6
psweights(.data, exposure, ps)

psweights_(.data, exposure_col, ps_col)

## S3 method for class 'pstools_psweights'
plot(x, ...)

Arguments

.data

a data.frame

exposure

the bare name for the column within .data indicating the exposure or non-exposure. Expect this to be an integer, or coercible to an integer with values of zero or one.

ps

the propensity scores. Expected values between 0 and 1.

exposure_col

a character string

ps_col

a character string

x

a pstools_psweights object

...

ignored

Details

Let p denote the propensity score for a subject. The five weights are as follows.

Exposed Non-Exposed
Average causal effect in study population psw_IPW 1/p 1/(1-p)
Average causal effect in exposed psw_ACE_Exposed 1 p/(1-p)
Average causal effect in unexposed psw_ACE_Unexposed (1-p)/p 1
Average causes effect in population for which sample is most informative psw_ACE_MostInfo 1-p p
Average causal effect in mathcin weight population psw_ACE_MWP min(p,(1-p))/p min(p,(1-p))/(1-p)

Value

a data.frame with the exposure and ps vectors returned along with five different weights. See Details for information on the five weights.

Methods (by generic)

References

Li, Liang, and Tom Greene. "A weighting analogue to pair matching in propensity score analysis." The international journal of biostatistics 9.2 (2013): 215-234.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
glmfit <- stats::glm(PCR_RSV ~ SEX + RSVINF + REGION + AGE + ELTATOP + EINZ + EXT, 
                     data = pride,
                     family = stats::binomial()) 

ourpride <- dplyr::mutate(pride, pp = qwraps2::invlogit(fitted(glmfit))) 

psw <- psweights(dplyr::tbl_df(ourpride), PCR_RSV, pp)
psw

# Mirrored Histograms
plot(psw)

dewittpe/pstools documentation built on May 15, 2019, 5:07 a.m.