An implementation of data analytic methods in R for analyses for data with ceiling/floor effects. The package currently includes functions for mean/variance estimation and mean comparison tests. Implemented methods are from Aitkin (1964)
The goal of DACF is to implement methods to deal with challenges associated with ceiling/floor effects in the data using paramtric methods that assume normality for the true scores.
You can install DACF from github with:
devtools::install_github("QMmmmLiu/DACFD")
This is a basic example which shows you how to solve a common problem:
library(DACF)# Simulate healthy data for two groupsx.1=rnorm(300,2,4)x.2=rnorm(300,3,5)# check mean and variance for simulated healthy datamean(x.1);var(x.1)#> [1] 2.046914#> [1] 12.34239mean(x.2);var(x.2)#> [1] 3.054255#> [1] 19.49582# induce ceiling effects of 20% in group 1x.1.cf=induce.cfe(.2,0,x.1)# induce floor effects of 10% in group 2x.2.cf=induce.cfe(0,.1,x.2)# recover the mean and variance for ceiling/floor datarec.mean.var(x.1.cf)#> $ceiling.percentage#> [1] 0.003333333#>#> $floor.percentage#> [1] 0.24#>#> $est.mean#> [1] 2.141253#>#> $est.var#> [1] 11.79842rec.mean.var(x.2.cf)#> $ceiling.percentage#> [1] 0.1#>#> $floor.percentage#> [1] 0.003333333#>#> $est.mean#> [1] 2.959067#>#> $est.var#> [1] 18.01588# conduct a t test on healthy datat.test(x.1,x.2)#>#> Welch Two Sample t-test#>#> data: x.1 and x.2#> t = -3.0922, df = 569.26, p-value = 0.002084#> alternative hypothesis: true difference in means is not equal to 0#> 95 percent confidence interval:#> -1.6472027 -0.3674792#> sample estimates:#> mean of x mean of y#> 2.046914 3.054255t.test(x.1.cf,x.2.cf)#>#> Welch Two Sample t-test#>#> data: x.1.cf and x.2.cf#> t = -1.1283, df = 550.93, p-value = 0.2597#> alternative hypothesis: true difference in means is not equal to 0#> 95 percent confidence interval:#> -0.8717900 0.2356737#> sample estimates:#> mean of x mean of y#> 2.473312 2.791370# conduct an adjusted t test on ceiling/floor datalw.t.test(x.1.cf,x.2.cf,"a")#> $statistic#> [1] -2.37371#>#> $p.value#> [1] 0.0183786#>#> $est.d#> [1] -0.2099299#>#> $conf.int#> [1] -1.4964171 -0.1392114lw.t.test(x.1.cf,x.2.cf,"b")#> $statistic#> [1] -2.594197#>#> $p.value#> [1] 0.009970491#>#> $est.d#> [1] -0.2118153#>#> $conf.int#> [1] -1.4383181 -0.1973104# generate a dataframe for ANOVA demotestdat=threeganova.sim(10000,.0625,1)# induce ceiling/floor effects in the datatestdat.cf=testdattestdat.cf[testdat.cf$group==2,]$y=induce.cfe(.2,0,testdat.cf[testdat.cf$group==2,]$y)# conduct an adjusted F star test on ceiling/floor datalw.f.star(testdat.cf,y~group,"a")#> $statistic#> [1] 868.0733#>#> $p.value#> [1] 0#>#> $est.f.squared#> [1] 0.05787155lw.f.star(testdat.cf,y~group,"b")#> $statistic#> [1] 781.9596#>#> $p.value#> [1] 0#>#> $est.f.squared#> [1] 0.05591017