Encoding Data

Functions for encoding data prior to model estimation.

recodeData()

Returns a list of the design matrix X and updated pars and randPars to include any dummy-coded categorical or interaction variables.

Estimating Models

Functions for estimating multinomial logit models with preference space and WTP space utility parameterizations.

logitr()

The main function for estimating logit models

Viewing Results

Functions for viewing the results of estimated models.

logLik(<logitr>) terms(<logitr>) coef(<logitr>) coef(<summary.logitr>) summary(<logitr>) print(<logitr>) print(<summary.logitr>) print(<logitr_wtp>)

Methods for logitr objects

se(<logitr>)

Extract standard errors

se()

Extract standard errors

vcov(<logitr>)

Calculate the variance-covariance matrix

fitted(<logitr>)

Extract Model Fitted Values

residuals(<logitr>)

Extract Model Residuals

statusCodes()

View a description the nloptr status codes

Computing and Comparing WTP

Functions for computing and comparing WTP from estimated models.

wtp()

Get WTP estimates a preference space model

wtp(<logitr>)

Get WTP estimates a preference space model

wtpCompare()

Compare WTP from preference and WTP space models

Predicting Probabilities & Outcomes

Functions for predicting probabilities and outcomes.

predict(<logitr>)

Predict probabilities and / or outcomes

Tidy / Broom Methods

Methods for tidying up results from estimate models.

augment(<logitr>)

Glance a logitr class object

confint(<logitr>)

Extract Model Confidence Interval

glance(<logitr>)

Glance a logitr class object

model.frame(<logitr>)

Extracting the Model Frame from a Formula or Fit

model.matrix(<logitr>)

Construct Design Matrices

tidy(<logitr>)

Tidy a logitr class object

Example Data Sets

Descriptions of data included with this package

yogurt

Choice observations of yogurt purchases by 100 households

cars_us

Stated car choice observations by US car buyers

cars_china

Stated car choice observations by Chinese car buyers

apolloModeChoiceData

Simulated SP dataset of mode choice (from the apollo package).

electricity

Stated preference data for the choice of electricity suppliers (from mlogit package)

runtimes

Data frame of run times for logitr benchmark

Other Helpers

Other helper functions.

fquantile()

Predict probabilities and / or outcomes

ci()

Obtain a confidence interval from coefficient draws

logit_probs()

Compute logit fraction for sets of alternatives given coefficient draws