neg.paired | R Documentation |
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)
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, ...)
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 |
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.
A list
including the following:
meanx
Sample mean of the first population/group.
meany
Sample mean of the second population/group.
medx
Sample median of the first population/group.
medy
Sample median second population/group.
sdx
Sample standard deviation of the first population/group.
sdy
Sample standard deviation of the second population/group.
madx
Sample median absolute deviation of the first population/group.
mady
Sample median absolute deviation of the second population/group.
neiL
Lower bound of the negligible effect (equivalence) interval.
neiU
Upper bound of the negligible effect (equivalence) interval.
effsizeraw
Simple difference in the means (or medians if normality = FALSE)
cilraw2
Lower bound of the 1-alpha CI for the raw mean difference.
ciuraw2
Upper bound of the 1-alpha CI for the raw mean difference.
cilraw
Lower bound of the 1-2*alpha CI for the raw mean difference.
ciuraw
Upper bound of the 1-2*alpha CI for the raw mean difference.
effsized
Standardized mean (or median if normality = FALSE) difference.
cild
Lower bound of the 1-alpha CI for the standardized mean (or median if normality = FALSE) difference.
ciud
Upper bound of the 1-alpha CI for the standardized mean (or median if normality = FALSE) difference.
effsizepd
Proportional distance statistic.
cilpd
Lower bound of the 1-alpha CI for the proportional distance statistic.
ciupd
Upper bound of the 1-alpha CI for the proportional distance statistic.
t1
First t-statistic from the TOST procedure.
t1
Second t-statistic from the TOST procedure.
df1
Degrees of freedom for the first t-statistic from the TOST procedure.
df2
Degrees of freedom for the second t-statistic from the TOST procedure.
pval1
p value associated with the first t-statistic from the TOST procedure.
pval2
p value associated with the second t-statistic from the TOST procedure.
alpha
Nominal Type I error rate
seed
Seed number
Rob Cribbie cribbie@yorku.ca Naomi Martinez Gutierrez naomimg@yorku.ca
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.