first_stage: Estimates the first stage of a sorting model

View source: R/first_stage.R

first_stageR Documentation

Estimates the first stage of a sorting model

Description

Estimates the first stage of a sorting model

Usage

first_stage(code_name, Z_names, X_names, data, print_detail = 3)

Arguments

code_name

Indicates (with name or column number) the vector with alternative chosen

Z_names

Indicates (with names or column numbers) the vectors with individual data

X_names

Indicates (with names or column numbers) the vectors with alternative data

data

Dataset to be used

print_detail

Controls the output detail of maxLik (default is set at 3)

Details

Optimization occurs via the maxLik package for an obtimization of a conditional logit model

Value

A (maxLik) object with the estimates (maxLik) together with the indicators of the alternative chosen, the vectors with individual data, the vectors with city/regional data and the name of the reference alternative

Examples

code_name <- c("mun_code")
Z_names <- c("age","income")
X_names <- c("lnprice","nature","monuments")
data <- municipality
s1.results <- first_stage(code_name, Z_names, X_names, data, print_detail = 1)

Thdegraaff/sortingmod documentation built on March 15, 2023, 12:31 a.m.