Example 2

Connor Gilroy

2017-07-17

source("init.R")
# example 2 ----
# subset to constructed variables
# process by converting all variables, removing all NAs,
# and removing variables that are unusable for modeling
# then merge with train

background <- read_dta("data/background.dta")
train <- read_csv("data/train.csv")
## Parsed with column specification:
## cols(
##   challengeID = col_integer(),
##   gpa = col_double(),
##   grit = col_double(),
##   materialHardship = col_double(),
##   eviction = col_integer(),
##   layoff = col_integer(),
##   jobTraining = col_integer()
## )
ffc <- 
  background %>% 
  subset_vars_keep(get_vars_constructed) %>%
  process_data_maximal() %>%
  merge_train(train)