
This function estimates a binary logistic regression model and calculates the corresponding marginal effects.
logitmfx(formula, data, atmean = TRUE, robust = FALSE, clustervar1 = NULL,
clustervar2 = NULL, start = NULL, control = list())
an object of class ``formula'' (or one that can be coerced to that class).
the data frame containing these data. This argument must be used.
default marginal effects represent the partial effects for the average observation.
If atmean = FALSE
the function calculates average partial effects.
if TRUE
the function reports White/robust standard errors.
a character value naming the first cluster on which to adjust the standard errors.
a character value naming the second cluster on which to adjust the standard errors for two-way clustering.
starting values for the parameters in the glm
model.
see glm.control
.
a coefficient matrix with columns containing the estimates, associated standard errors, test statistics and p-values.
the fitted glm
object.
a character vector containing the variable names where the marginal effect refers to the impact of a discrete change on the outcome. For example, a factor variable.
the matched call.
If both robust=TRUE
and !is.null(clustervar1)
the function overrides the robust
command and computes clustered standard errors.
William H. Greene (2008). Econometric Analysis (6th ed.). Prentice Hall, N.Y. pp 770-787.
# NOT RUN {
# simulate some data
set.seed(12345)
n = 1000
x = rnorm(n)
# binary outcome
y = ifelse(pnorm(1 + 0.5*x + rnorm(n))>0.5, 1, 0)
data = data.frame(y,x)
logitmfx(formula=y~x, data=data)
# }
Run the code above in your browser using DataLab