cf_correction: cf_correction

View source: R/cf_correction.R

cf_correctionR Documentation

cf_correction

Description

Extends Tukey's HSD and Bonferroni procedure to account for ceiling and floor effects

Usage

cf_correction(
  x,
  tests = "all",
  df.adjustment = "trunc",
  gh.correction = "no_gh",
  alpha = 0.05,
  flr,
  ceil
)

Arguments

x

a dataframe of data with ceiling/floor effects and corresponding group variables or aov results

tests

a character string specifying the desired multiple-comparison procedure: "all" (default, Tukey's HSD and Bonferroni), "tukey" (Tukey's HSD), or "bonf" (Bonferroni)

df.adjustment

a character string specifying the desired method for adjusting the degree of freedom: "trunc" (default, Liu and Wang's truncated-normal corrections) or "unadj" (unadjusted)

gh.correction

a character string specifying if the Welch & Games-Howell correction for heteroscedasticity should be included: "no_gh"(default) or "yes_gh"

alpha

a (non-empty) numeric value of desired of alpha level

flr

a (non-empty) numeric value of the floor threshold (e.g., the minimum score of the measurement scale)

ceil

a (non-empty) numeric value of the ceiling threshold (e.g., the maximum score of the measurement scale)

Value

a matrix containing pairwise comparison results. Columns depend on the tests and gh.correction arguments:

  • Comparison_i: First group in the comparison

  • Comparison_j: Second group in the comparison

  • mean_i: The adjusted mean of the first group

  • mean_j: The adjusted mean of the second group

  • diff_in_means: The difference in adjusted means

  • tukey.CI_lwr: Lower bound of Tukey's HSD confidence interval (tests = "tukey" or "all")

  • tukey.CI_upr: Upper bound of Tukey's HSD confidence interval (tests = "tukey" or "all")

  • hedges_g: Hedges' g effect size (tests = "tukey" or "all")

  • Q: Adjusted Tukey's Q statistic (tests = "tukey" or "all")

  • p: p-value for Tukey's Q statistic (tests = "tukey" or "all")

  • t: t-test statistic (tests = "bonf" or "all")

  • t_p: p-value for the t-test statistic (tests = "bonf" or "all")

  • p.bonferroni: Bonferroni-adjusted p-value (tests = "bonf" or "all")

  • bonf.CI_lwr: Lower bound of Bonferroni confidence interval (tests = "bonf" or "all")

  • bonf.CI_upr: Upper bound of Bonferroni confidence interval (tests = "bonf" or "all")

  • gh.CI_lwr: Lower bound of Games-Howell confidence interval (gh.correction = "yes_gh", tests = "tukey" or "all")

  • gh.CI_upr: Upper bound of Games-Howell confidence interval (gh.correction = "yes_gh", tests = "tukey" or "all")

  • games.howell.t: Games-Howell t statistic (gh.correction = "yes_gh", tests = "tukey" or "all")

  • games.howell.p: Games-Howell p-value (gh.correction = "yes_gh", tests = "tukey" or "all")

  • games.howell.g: Games-Howell Hedges' g (gh.correction = "yes_gh", tests = "tukey" or "all")

  • welch.satterthwaite.df: Welch-Satterthwaite degrees of freedom (gh.correction = "yes_gh")

  • welch.bonf.CI_lwr: Lower bound of Welch-Bonferroni confidence interval (gh.correction = "yes_gh", tests = "bonf" or "all")

  • welch.bonf.CI_upr: Upper bound of Welch-Bonferroni confidence interval (gh.correction = "yes_gh", tests = "bonf" or "all")

  • t_Welch: Welch t statistic (gh.correction = "yes_gh", tests = "bonf" or "all")

  • p_Welch: Welch p-value (gh.correction = "yes_gh", tests = "bonf" or "all")

  • p_Welch.bonferroni: Welch Bonferroni-adjusted p-value (gh.correction = "yes_gh", tests = "bonf" or "all")

References

Aitkin MA. Correlation in a Singly Truncated Bivariate Normal Distribution. Psychometrika. 1964;29(3):263-270. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/BF02289723")}

Cohen, A. C. (1959). Simplified Estimators for the Normal Distribution When Samples Are Singly Censored or Truncated. AnnalsTechnometrics, 1(3), 217–237. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00401706.1959.10489859")}

Greene, W. H. (2002). Econometric Analysis. In Econometric Analysis.

Liu, Q., Wang, L. (2020) t-Test and ANOVA for data with ceiling and/or floor effects. Behav Res 53, 264–277 . \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3758/s13428-020-01407-2")}

Qi, H., Dong, Z., Wei, Q., Chen, X., & Luo, Y. (2025). Are Gamers Happier? Multidimensional Well-Being Differences in Risk Groups for Problematic Internet Use and Internet Gaming Disorder. Personality and Individual Differences 246, 113334. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2139/ssrn.5148047")}

Examples

data("Qi_data_males") # (Qi et al., 2025)
cf_correction(Qi_data_males, tests = "all", df.adjustment = "trunc",
              gh.correction = "yes_gh", alpha = .05, flr = 0, ceil = 9)
cf_correction(Qi_data_males, tests = "tukey", df.adjustment = "unadj",
              gh.correction = "no_gh", alpha = .05, flr = 0, ceil = 9)
cf_correction(Qi_data_males, tests = "all", df.adjustment = "unadj",
              gh.correction = "no_gh", alpha = .05, flr = 0, ceil = 9)

DACF documentation built on July 17, 2026, 1:07 a.m.