model_and_convert: The length of a string (in characters).

Description Usage Arguments Value See Also Examples

Description

The length of a string (in characters).

Usage

1
2
model_and_convert(response, predictor_list, svydesignObj, test.set,
  plot = T)

Arguments

response

a character string identifying the response variable

predictor_list

a list whose elements are vectors of character strings specifying the desired predictor variables. A svyglm model is created for each element of the list.

svydesignObj

a svydesign object from which to create the svyglm models

test.set

a data frame whose variables match the svydesignObj, which is used to build ROC curves based on prediction

plot

a Boolean indicating whether to plot the ROC curves for each model

Value

A data frame of ROC curve values for each input formula

See Also

predROC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(list = c("GES2013.drivers.design", "GES2013.drivers"))
GES2013.drivers$TIME_TRANSFORM <- sapply(GES2013.drivers$TIME_OF_WEEK, function (x) .0026*exp(3*cos(2*pi*(x-4)/24)) + .0037*cos(2*pi*floor(x/24)/7) + .0034)
GES2013.drivers$AGE_TRANSFORM <- GES2013.drivers$AGE_IM^2
GES2014.drivers$TIME_TRANSFORM <- sapply(GES2014.drivers$TIME_OF_WEEK, function (x) .0026*exp(3*cos(2*pi*(x-4)/24)) + .0037*cos(2*pi*floor(x/24)/7) + .0034)
GES2014.drivers$AGE_TRANSFORM <- GES2014.drivers$AGE_IM^2
GES2013.drivers.design <- update(GES2013.drivers.design,
                                                         TIME_TRANSFORM = GES2013.drivers$TIME_TRANSFORM,
                                                         AGE_TRANSFORM = GES2013.drivers$AGE_TRANSFORM)
response <- "DROWSY"
predictor_list <- list(c ("HEAVY_TRUCK",  "INT_HWY",  "SEX_IM", "SPEEDREL", "TIME_TRANSFORM", "AGE_TRANSFORM"),
                                 c ("HEAVY_TRUCK",  "INT_HWY",  "SEX_IM", "SPEEDREL"))
model_and_convert(response, predictor_list, GES2013.drivers.design, GES2014.drivers)

PatrickCoyle/analyzeGES documentation built on May 26, 2019, 4:38 p.m.