| neg.paired {negligible} | R Documentation |
Negligible Effect Test on the Difference between the Means of Dependent Populations
Description
This function allows researchers to test whether the difference between the means of two dependent populations is negligible, where negligible represents the smallest meaningful effect size (MMES)
Usage
neg.paired(
var1 = NULL,
var2 = NULL,
outcome = NULL,
group = NULL,
ID = NULL,
neiL,
neiU,
normality = TRUE,
nboot = 10000,
alpha = 0.05,
plot = TRUE,
saveplot = FALSE,
data = NULL,
seed = NA,
...
)
## S3 method for class 'neg.paired'
print(x, ...)
Arguments
var1 |
Data for Group 1 (if outcome, group and ID are omitted) |
var2 |
Data for Group 2 (if outcome, group and ID are omitted) |
outcome |
Dependent Variable (if var1 and var2 are omitted) |
group |
Dichotomous Predictor/Independent Variable (if var1 and var2 are omitted) |
ID |
participant ID (if var1 and var2 are omitted) |
neiL |
Lower Bound of the Equivalence Interval |
neiU |
Upper Bound of the Equivalence Interval |
normality |
Are the population variances (and hence the residuals) assumed to be normally distributed? |
nboot |
Number of bootstrap samples for calculating CIs |
alpha |
Nominal Type I Error rate |
plot |
Should a plot of the results be produced? |
saveplot |
Should the plot be saved? |
data |
Dataset containing var1/var2 or outcome/group/ID |
seed |
Seed number |
... |
Extra arguments |
x |
object of class |
Details
This function evaluates whether the difference in the means of 2 dependent populations can be considered negligible (i.e., the population means can be considered equivalent).
The user specifies either the data associated with the first and second groups/populations (var1, var2, both should be continuous) or specifies the Indepedent Variable/Predictor (group, should be a factor) and the Dependent Variable (outcome, should be continuous). A 'data' statement can be used if the variables are stored in an R dataset.
The user must also specify the lower and upper bounds of the negligible effect (equivalence) interval. These are specified in the original units of the outcome variable.
Value
A list including the following:
-
meanxSample mean of the first population/group. -
meanySample mean of the second population/group. -
medxSample median of the first population/group. -
medySample median second population/group. -
sdxSample standard deviation of the first population/group. -
sdySample standard deviation of the second population/group. -
madxSample median absolute deviation of the first population/group. -
madySample median absolute deviation of the second population/group. -
neiLLower bound of the negligible effect (equivalence) interval. -
neiUUpper bound of the negligible effect (equivalence) interval. -
effsizerawSimple difference in the means (or medians if normality = FALSE) -
cilraw2Lower bound of the 1-alpha CI for the raw mean difference. -
ciuraw2Upper bound of the 1-alpha CI for the raw mean difference. -
cilrawLower bound of the 1-2*alpha CI for the raw mean difference. -
ciurawUpper bound of the 1-2*alpha CI for the raw mean difference. -
effsizedStandardized mean (or median if normality = FALSE) difference. -
cildLower bound of the 1-alpha CI for the standardized mean (or median if normality = FALSE) difference. -
ciudUpper bound of the 1-alpha CI for the standardized mean (or median if normality = FALSE) difference. -
effsizepdProportional distance statistic. -
cilpdLower bound of the 1-alpha CI for the proportional distance statistic. -
ciupdUpper bound of the 1-alpha CI for the proportional distance statistic. -
t1First t-statistic from the TOST procedure. -
t1Second t-statistic from the TOST procedure. -
df1Degrees of freedom for the first t-statistic from the TOST procedure. -
df2Degrees of freedom for the second t-statistic from the TOST procedure. -
pval1p value associated with the first t-statistic from the TOST procedure. -
pval2p value associated with the second t-statistic from the TOST procedure. -
alphaNominal Type I error rate -
seedSeed number
Author(s)
Rob Cribbie cribbie@yorku.ca Naomi Martinez Gutierrez naomimg@yorku.ca
Examples
#wide format
ID<-rep(1:20)
control<-rnorm(20)
intervention<-rnorm(20)
d<-data.frame(ID, control, intervention)
head(d)
neg.paired(var1=control,var2=intervention,neiL=-1,neiU=1,plot=TRUE,
data=d)
neg.paired(var1=d$control,var2=d$intervention,neiL=-1,neiU=1,plot=TRUE)
neg.paired(var1=d$control,var2=d$intervention,neiL=-1,neiU=1,normality=FALSE,
nboot=10,plot=TRUE)
## Not run:
#long format
sample1<-sample(1:20, 20, replace=FALSE)
sample2<-sample(1:20, 20, replace=FALSE)
ID<-c(sample1, sample2)
group<-rep(c("control","intervention"),c(20,20))
outcome<-c(control,intervention)
d<-data.frame(ID,group,outcome)
neg.paired(outcome=outcome,group=group,ID=ID,neiL=-1,neiU=1,plot=TRUE,data=d)
neg.paired(outcome=d$outcome,group=d$group,ID=d$ID,neiL=-1,neiU=1,plot=TRUE)
neg.paired(outcome=d$outcome,group=d$group,ID=d$ID,neiL=-1,neiU=1,plot=TRUE, normality=FALSE)
#long format with multiple variables
sample1<-sample(1:20, 20, replace=FALSE)
sample2<-sample(1:20, 20, replace=FALSE)
ID<-c(sample1, sample2)
attendance<-sample(1:3, 20, replace=TRUE)
group<-rep(c("control","intervention"),c(20,20))
outcome<-c(control,intervention)
d<-data.frame(ID,group,outcome,attendance)
neg.paired(outcome=outcome,group=group,ID=ID,neiL=-1,neiU=1,plot=TRUE,data=d)
neg.paired(outcome=d$outcome,group=d$group,ID=d$ID,neiL=-1,neiU=1,plot=TRUE)
#open a dataset
library(negligible)
d<-perfectionism
names(d)
head(d)
neg.paired(var1=atqpre.total,var2=atqpost.total,
neiL=-10,neiU=10,data=d)
#Dataset with missing data
x<-rnorm(10)
x[c(3,6)]<-NA
y<-rnorm(10)
y[c(7)]<-NA
neg.paired(x,y,neiL=-1,neiU=1, normality=FALSE)
## End(Not run)