Learn R Programming

nmm (version 0.9)

prepare_data: prepare_data prepare data for the estimation.

Description

prepare_data prepare data for the estimation.

Usage

prepare_data(
  data,
  choice = "",
  dummy = "",
  PeID = "",
  WeID = "",
  type = "",
  mode_spec_var = "",
  avl = TRUE,
  chc = TRUE,
  wc = TRUE,
  wd = TRUE,
  nc = 0,
  weights = NULL,
  weight_paths = FALSE,
  weight_paths_cont = FALSE,
  mode_factors = NULL
)

Arguments

data

data.frame

choice

Name of variable with modes.

dummy

Name of variable indicating, if the mode was chosen.

PeID

Name of variable with individual identification numbers.

WeID

Name of variable with trip identification.

type

Type of data. If "long", then modifications are done.

mode_spec_var

Used if format "long", mode specific variables.

avl

if TRUE, includes dummies for mode availability.

chc

if TRUE, includes dummies for choice of mode.

wc

if TRUE, creates weights 1 for continuous equations.

wd

if TRUE, creates weights 1 for discrete equations.

nc

Integer, number of continuous equations.

weights

Data matrix with weights, column names have to be $wc_i$(continuous), $wd_i$(discrete).

weight_paths

if TRUE, weight according to number of trips per person, discrete part.

weight_paths_cont

if TRUE, weight continuous part.

mode_factors

if choice is not factor or numeric, this is important to supply.

Value

data.frame used for modeling.

Examples

Run this code
# NOT RUN {
data("TravelMode", package = "AER")
mode_spec_var <- c("wait", "vcost", "travel", "gcost")
res <- prepare_data(TravelMode, choice="mode", dummy="choice", PeID="individual", WeID="",
type="long", mode_spec_var =mode_spec_var, nc=3)
# }

Run the code above in your browser using DataLab