Wrapper function for oglmx
to estimate the binary response logit model.
logit.reg(formula, data, start = NULL, weights=NULL, beta = NULL,
analhessian = TRUE, na.action, savemodelframe = FALSE, robust = FALSE)
an object of class formula
: a symbolic description of the model used to explain the mean of the latent variable. The response variable should be a numeric vector or factor variable with two values.
a data frame containing the variables in the model.
either NULL
or a numeric vector specifying start values for each of the estimated parameters, passed to the maximisation routine.
either NULL
or a numeric vector of length equal to the number of rows in the data frame. Used to apply weighted maximum likelihood estimation.
NULL
or numeric vector. Used to prespecify elements of the parameter vector for the equation of the mean of the latent variable. Vector should be of length one or of length equal to the number of explanatory variables in the mean equation. If of length one the value is presumed to correspond to the constant. If of length greater than one then NA
should be entered for elements of the vector to be estimated.
logical. Indicates whether the analytic Hessian should be calculated and used, default is TRUE, if set to FALSE a finite-difference approximation of the Hessian is used.
a function which indicates what should happen when the data contain NAs. The default is set by the na.action
setting of options
, and is na.fail
if that is unset. The factory-fresh default is na.omit
. Another possible value is NULL
, no action. Value na.exclude
can be useful.
logical. Indicates whether the model frame(s) should be saved for future use. Default is FALSE
. Should be set to TRUE
if intending to estimate Average Marginal Effects.
logical. If set to TRUE
the outer product or BHHH estimate of the meat in the sandwich of the variance-covariance matrix is calculated. If calculated standard errors will be calculated using the sandwich estimator by default when calling summary
.
object of class "oglmx
", see oglmx
.
glm
for alternative method to estimate a logit model. oglmx
. To obtain marginal effects see margins.oglmx
.