empBayes: empBayes

Description Usage Arguments Details Value Author(s) Examples

Description

Calculates Crash Modification Factor (CMF) for a before/after traffic study using Empirical Bayes to avoid regression to the mean (RTM)

Usage

1
2
3
empBayes(reference, before, after, depVar, offsetVar = NULL,
  indepVars = setdiff(names(reference), c(depVar, offsetVar)),
  forceKeep = NULL, alpha = 0.95)

Arguments

reference

Reference data

before

Treatment data, before some change was made

after

Treatment data, after some change was made

depVar

The dependent variable (the number of crashes - should always be of class integer or numeric).

offsetVar

An offset variable (eg years)

indepVars

Variables used to model the outcome variable depVar

forceKeep

A character vector of variable names. These variables will not be considered for removal during the variable selection process.

alpha

Level of confidence

Details

None at this time

Value

Returns a list object containing the CMF, its variance, standard error, and 1-alpha/2 CI

Author(s)

Jung-han Wang and Robert Norberg

Examples

1
2
3
4
5
data(Reference)
data(Before)
data(After)
empBayes(reference = Reference, before = Before, after = After,
 depVar = "kabco", offsetVar = "year")

rnorberg/bastudy documentation built on May 27, 2019, 9:57 a.m.