nemtr | R Documentation |
Take a dataframe, validate it, and then conduct the Nonparametric Extended Median Test to generate and display a control chart
nemtr( dataFrame, timing, streams, VoI = NA, type = "long", median0 = NA, delta = 3 )
dataFrame |
A user inputted dataframe, can be wide or long |
timing |
A string of the timing variable name |
streams |
A string of the streams variable name |
VoI |
A string of the Variable of Interest name |
type |
A string of the type of data (default long) |
median0 |
A value for expected median |
delta |
A value for delta (default 3) |
A validated dataframe in long format
set.seed(795014178) streams <- 20 time <- 60 samples <- 15 mu0 <- 3 delta <- 3 library(dplyr) turnstiles <- tibble( turnstile = rep(rep(1:streams,each=samples),time), hour = rep(1:time,each=streams * samples), sample = rep(rep(1:samples), times = streams * time), waitTime = rexp(streams * time * samples,rate=.22985) ) %>% mutate(waitTime = if_else(hour == 38, waitTime * 2,waitTime)) nemtr(turnstiles, timing="hour", streams="sample", VoI="waitTime", type="long", median0 = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.