knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
We will analyze SingSparrow data to decide whether the key contingencies must be switched.
We will assume that the last rows of the dataframe contain the most recent keypresses.
library(songPreference) data <- loadOC(birDir = file.path(find.package("songPreference"), "ZF1536"))
The main function here is shouldISwitch
. It will print out the decission of whether to switch or not.
reversal_decision <- shouldISwitch(data= data, alpha = 0.05, consecutive_days = 5, filtype= "onesong")
The first two columns are the daily press counts for A and B. The third column contains the p value from the statistical test of significant difference between the key press counts. The row numbers are a way of representing dates. They correspond to the number of days since 1970-01-01. This type of numeric representation is usually a convenient way for R to store information on dates.
Finally, the last line contains the decision to run or not to run a reversal.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.