glm_function: Fitting Logit Models

Description Usage Arguments Details Author(s) Examples

View source: R/glm_function.R

Description

The function "glm_function" is used to fit logit models, specified by giving a symbolic description of the linear predictor and a description of the error distribution.

Usage

1
  glm_function(Y, X, stval, data)

Arguments

Y

the dependent variable is a dichotomous dummy, taking the values of 0 and 1.

X

the independent variable must include the X-values (X = cbind(X1, X2, ..., Xk)).

stval

a named list of starting values for the parameters in the model (stval = c()).

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which lm is called.

Details

The "logit model" is a regression model where the dependent variable is categorical. This function covers the case of a binary dependent variable - that is, where the output can take only two values, 0 and 1, which represent outcomes such as pass/fail or win/lose. How can we interpret the output? The coefficients are on the linked scale - so a direct interpretation is not possible. The only thing we can interpret is the direction. A positive coefficient means an increase of the probability, a negative means a decrease.

Author(s)

Catherine Ammann: (catherine.ammann@uzh.ch) and Sergio Roethlisberger: (sergio.roethlisberger@uzh.ch)

Examples

1
2
## model = glm_function(my.data$Y, cbind(my.data$X1, my.data$X2), c(z0, z1, ..., zk), my.data)
## model

SergioRoethlisberger/regression documentation built on May 28, 2019, 3:15 p.m.