logit: Simple wrapper to estimate a binomial logit model by IWLS or...

Description Usage Arguments Value Examples

View source: R/autoGLM.R

Description

This function returns an estimated logit model.

Usage

1
2
logit(Z, method = "IWLS", start = "default", maximizer = "nlminb",
  wmatrix = "ident", gmmtype = "iterative")

Arguments

Z

dataset with dependent variable in the first column and explanatory variables in other columns.

method

either IWLS to estimate a glm by Iterated Weighted Least Squares, or GMM to estimate with method of moments.

start

starting values, defaults to vector of zeros for IWLS and guessStartVal for gmm.

maximizer,

maximizer used for GMM, either "nlminb" for port routines or "BFGS".

wmatrix

Defaults to "ident" for identity matrix weighting of the gmm estimator. Other option is "optimal" for inverse covariance weighting. See package "gmm" for details.

gmmtype,

Either "twostep" for the two step GMM proposed by Hansen(1982), and the "cue" and "iterative" for respectively the continuously and the iteratively updated methods proposed by Hansen, Eaton et Yaron (1996). See package "gmm" for details. Defaults to "iterative".

Value

A logit model fitted by glm()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(10101)
Z <- simulateLogit(nobs=1000, pars =c(0.25,-0.5, 0.1, -0.1, 0, 0))

# Iterated Weighted Least Squares
test<- logit(Z)
# GMM using port routines and the results of the IWLS as starting values
test2<- logit(Z, method="gmm", start=coef(test))
# GMM using BFGS and starting at correct parameters
test3<- logit(Z, method="gmm", maximizer="BFGS", start =c(0, 0.25,-0.5, 0.1, -0.1, 0, 0))
test4<- logit(Z, method="gmm")

BPJandree/AutoGLM documentation built on Nov. 6, 2018, 10:43 p.m.