prepare_data: 'prepare_data' prepare data for the estimation.

Description Usage Arguments Value Examples

Description

prepare_data prepare data for the estimation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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

1
2
3
4
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)

nmm documentation built on Jan. 7, 2021, 5:10 p.m.

Related to prepare_data in nmm...