Learn R Programming

logitr (version 1.1.2)

augment.logitr: Glance a logitr class object

Description

Glance a logitr class object

Usage

# S3 method for logitr
augment(x, newdata = NULL, obsID = NULL, type = "prob", ...)

Value

A tibble of ...

Arguments

x

is an object of class logitr.

newdata

a data.frame. Each row is an alternative and each column an attribute corresponding to parameter names in the estimated model. Defaults to NULL, in which case predictions are made on the original data used to estimate the model.

obsID

The name of the column that identifies each set of alternatives in the data. Required if newdata != NULL. Defaults to NULL, in which case the value for obsID from the data in object is used.

type

A character vector defining what to predict: prob for probabilities, outcomes for outcomes. If you want both outputs, use c("prob", "outcome"). Outcomes are predicted randomly according to the predicted probabilities. Defaults to "prob".

...

further arguments.

Examples

Run this code
library(logitr)

# Estimate a preference space model
mnl_pref <- logitr(
  data    = yogurt,
  outcome = "choice",
  obsID   = "obsID",
  pars    = c("price", "feat", "brand")
)

# Extract a tibble of the model summary statistics
augment(mnl_pref)

Run the code above in your browser using DataLab