Learn R Programming

logitr (version 1.1.2)

model.frame.logitr: Extracting the Model Frame from a Formula or Fit

Description

Returns a data.frame with the variables needed to use formula and any ... arguments.

Usage

# S3 method for logitr
model.frame(formula, ...)

Value

A data.frame with the variables needed to use formula and any ... arguments.

Arguments

formula

a model formula or terms object or an R object.

...

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")
)

# Get the model.frame data frame
model.frame(mnl_pref)

Run the code above in your browser using DataLab