mfx (version 1.2-2)

logitor: Odds ratios for a logit regression.

Description

This function estimates a binary logistic regression model and calculates the corresponding odds ratios.

Usage

logitor(formula, data, robust = FALSE, clustervar1 = NULL, clustervar2 = NULL, 
        start = NULL, control = list())

Arguments

formula

an object of class ``formula'' (or one that can be coerced to that class).

data

the data frame containing these data. This argument must be used.

robust

if TRUE the function reports White/robust standard errors.

clustervar1

a character value naming the first cluster on which to adjust the standard errors.

clustervar2

a character value naming the second cluster on which to adjust the standard errors for two-way clustering.

start

starting values for the parameters in the glm model.

control

Value

oddsratio

a coefficient matrix with columns containing the estimates, associated standard errors, test statistics and p-values.

fit

the fitted glm object.

call

the matched call.

Details

If both robust=TRUE and !is.null(clustervar1) the function overrides the robust command and computes clustered standard errors.

See Also

logitmfx, glm

Examples

Run this code
# 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)
logitor(formula=y~x, data=data)
# }

Run the code above in your browser using DataLab