extract_indiv_data: Extract the individual level data from the dataset for use in...

Description Usage Arguments Value Examples

View source: R/helper_functions.R

Description

Extract the individual level data from the dataset for use in posterior analysis

Usage

1

Arguments

data

The dataset

data_cols

The individual level columns of attributes - Can be null to take aggregate for each column

Value

dataframe of all individual level data for each ID

Examples

1
2
3
4
5
6
data("Train", package="mlogit")
Train$ID <- Train$id
Train$CHOICE <- as.numeric(Train$choice)
#in this case not actually individual data columns 
#an ID column is required here
extract_indiv_data(Train, c('comfort_A', 'comfort_B'))

mixl documentation built on Oct. 23, 2020, 7:28 p.m.