dstats: Descriptive Statistics

Description Usage Arguments Details Value References See Also Examples

Description

Given a logistic regression model, generate the propensity weights for the subjects (rows) in the data set and report the descriptive statistics for each predictor in the regression model.

Usage

1
2
3
4
dstats(x, ...)

## S3 method for class 'formula'
dstats(formula, data, ps, ...)

Arguments

x

a regression object with class glm

...

ignored

formula

a regression formula of the form exposure ~ predictors1 + predictors2

data

a date.frame

ps

the bare column name in data indicating the propensity scores

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 dstats will return a mean (sd), that is, if the formula for the regression model is of the form y ~ male, dstats will summarize the variable male as if it was continous predictor. To get the summary of the proportion of males, and females will be reported too, use a regression formula of the form y ~ factor(male).

See psweights for details on the propensity score based weights used by dstats.

Value

A pstools_dstats object which is a data.frame, with descriptive statistics for each variable in and out of the exposure group.

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.

See Also

glm for fitting logistic regression models, or geeglm for fitting GEEs. psweights for the weights.

Examples

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

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