get_margins: Get Marginal Probabilities for a Logistic Regression Model

Description Usage Arguments Value

View source: R/get_margins.R

Description

For a logistic regression model that includes one main effect and zero or more adjustors, obtain marginal probalities for the outcome variable with respect to the main effect. This reproduces the behavior of running margins x after fitting the logistic regression model in Stata.

Usage

1
get_margins(model_data, betas, sigma, main_effect, over)

Arguments

model_data

The data used to fit the Logistic Regression model

betas

The beta coefficients obtained from fitting the Logistic Regression model

sigma

The variance-covariance matrix obtained from fitting the Logistic Regression model

main_effect

The name of the variable corresponding to the main effect in your model.

over

A Boolean variable. If TRUE, compute the equivalent of the Stata command margins, over(var_name). If FALSE, compute the equivalent of margins var_name.

Value

The marginal probabilities, their standard errors, and their variance-covariance matrix.


jameshenegan/dmsepmlr documentation built on Jan. 1, 2021, 4:27 a.m.