marginal_regex <- "margin\w (?:\w+\s+){0,5}significan\w|trend\w (?:\w+\s+){0,1}significan\w|almost (?:\w+\s+){0,4}significan\w|approach\w (?:\w+\s+){0,4}significan\w|border\w (?:\w+\s+){0,4}significan\w|close to (?:\w+\s+){0,3}significan\w"
text_found <- search_text(xml, marginal_regex)
result_df <- data.frame(problem = rep("An interpretation of a 'marginally significant' effect was found", length(text_found)), text = text_found, solution = rep("Researchers sometimes treat p values just above the alpha level as suggestive of support for their prediction. Only p-values smaller than the alpha level are significant. Values above the alpha level are not 'marginally significant' or 'trending away from significant'. Interpreting p-values above the alpha level as support for your prediction increases the Type 1 error rate. Instead, interpret the result as non-significant and reflect on whether the result was a Type 2 error, or use statistics that allow for continuous interpretations (e.g., a likelihood ratio)", length(text_found)))
Goal: detect incorrectly interpreting effects as marginally significant. Initial code below.
Marginal significance
marginal_regex <- "margin\w (?:\w+\s+){0,5}significan\w|trend\w (?:\w+\s+){0,1}significan\w|almost (?:\w+\s+){0,4}significan\w|approach\w (?:\w+\s+){0,4}significan\w|border\w (?:\w+\s+){0,4}significan\w|close to (?:\w+\s+){0,3}significan\w" text_found <- search_text(xml, marginal_regex) result_df <- data.frame(problem = rep("An interpretation of a 'marginally significant' effect was found", length(text_found)), text = text_found, solution = rep("Researchers sometimes treat p values just above the alpha level as suggestive of support for their prediction. Only p-values smaller than the alpha level are significant. Values above the alpha level are not 'marginally significant' or 'trending away from significant'. Interpreting p-values above the alpha level as support for your prediction increases the Type 1 error rate. Instead, interpret the result as non-significant and reflect on whether the result was a Type 2 error, or use statistics that allow for continuous interpretations (e.g., a likelihood ratio)", length(text_found)))