Description Usage Arguments Details Value References See Also Examples
Given a logistic regression model, generate the propensity weights for the subjects (rows) in the data set.
1 | propensity(fit, weight_method = 1)
|
fit |
a regression object such as |
weight_method |
one of three methods for defining the weight for each row of the data set. See Details. |
The regression model is expected to estimate the probability of an exposure (Z = 1) given a set of predictors, X, i.e., Pr[Z = 1 | X].
NOTE: for binary predictors coded as 0/1, such as male, the default action of propensity_summary will return a mean (sd), that is, if propensity_summary(geeglm(y ~ male)) will summarize the variable male as if it was continous predictor. To get the summary for the proportion of males, and females will be reported too, use propensity_summary(geeglm(y ~ factor(male))).
weight_method
controls the weight given to each row of the data set.
Let ps = Pr[Z = 1 | X]. The default setting is weight_method = 1
.
weight_method = 1
w = min(c(ps, 1-ps)) / (z*ps + (1-z)*(1-ps))
weight_method = 2
w = 1/(z*ps + (1-z)*(1-ps))
weight_method = 3
w = z + (1-z)*ps/(1-ps))
A pstools_propensity
object which is a
data.frame
with columns summarizing each varaible used as a predictor in the
propensity model. The function will determine if each variable is a
categorical or continous variable. if the variable is continuous the mean (sd)
is returned. If the variable is categorical the the percentage of each level
is returned. Standard differences are reported as well. Unadjusted and
Matched Weight (see Li and Greene (2012)) values are reported.
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.
glm
for fitting logistic regression models, or
geeglm
for fitting GEEs.
1 2 3 4 5 6 7 8 9 10 | ## Not run:
data(pride)
glmfit <- stats::glm(PCR_RSV ~ SEX + RSVINF + REGION + AGE + ELTATOP + EINZ + EXT,
data = pride,
family = stats::binomial())
propensity(glmfit)
summary(propensity(glmfit))
plot(propensity(glmfit))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.