Add a criterion to a hypothesis in a study object
add_criterion( study, id, result, operator, comparator, analysis_id = NULL, hypothesis_id = NULL )
study | A study list object with class scivrs_study |
---|---|
id | A unique name to refer to the criterion with in the evaluation |
result | The name of the item in the analysis results list to compare |
operator | The operator for comparison c("<", "=", ">", "!=") |
comparator | The value to compare |
analysis_id | The id for the relevant analysis (index or character) if NULL, assigns to the last analysis in the list |
hypothesis_id | The id for the hypothesis (index or character) if NULL, assigns to the last hypothesis in the list |
A study object with class scivrs_study
s <- study() %>% add_hypothesis("H1", "Petal width and length will be positively correlated.") %>% add_analysis("A1", cor.test(dat$Petal.Width, dat$Petal.Length)) %>% add_criterion("sig", "p.value", "<", 0.05) %>% add_criterion("pos", "estimate", ">", 0)