Title: | Hypothesis Testing Using the Overlapping Interval Estimates |
---|---|
Description: | Performs hypothesis testing using the interval estimates (e.g., confidence intervals). The non-overlapping interval estimates indicates the statistical significance. References to these procedures can be found at Noguchi and Marmolejo-Ramos (2016) <doi:10.1080/00031305.2016.1200487>, Bonett and Seier (2003) <doi:10.1198/0003130032323>, and Lemm (2006) <doi:10.1300/J082v51n02_05>. |
Authors: | Kimihiro Noguchi [aut, cre], Ryan Erps [ctb], Chris Murphy [ctb] |
Maintainer: | Kimihiro Noguchi <[email protected]> |
License: | GPL-3 |
Version: | 0.1.2 |
Built: | 2024-12-19 06:53:40 UTC |
Source: | CRAN |
Bonett-Seier t-test for comparing variability measures of two independent samples.
Bonett.Seier.test(x, y, alternative = c("two.sided", "less", "greater"), alpha = 0.05)
Bonett.Seier.test(x, y, alternative = c("two.sided", "less", "greater"), alpha = 0.05)
x |
A vector specifying the first sample. |
y |
A vector specifying the second sample. |
alternative |
A character string specifying the alternative hypothesis; "two.sided" for two-tailed, "less" for left-tailed, and "greater" for right-tailed alternative hypothesis. The default option is "two.sided". |
alpha |
A numeric specifying the significance level. The default option is 0.05. |
Statistic |
The test statistic. |
p.value |
The p-value. |
Estimate |
The ratio of variability measures. |
Lower.CI |
The lower bound of the confidence interval. |
Upper.CI |
The upper bound of the confidence interval. |
set.seed(123) x<-runif(10) y<-runif(15) Bonett.Seier.test(x,y,"two.sided",0.05)
set.seed(123) x<-runif(10) y<-runif(15) Bonett.Seier.test(x,y,"two.sided",0.05)
Data transformation for testing equality of variability measures (mean absolute deviation from median or variance).
data.scale.xy(x, y, scale.option = c("Levene.Med.0", "Levene.Med", "Levene.Med.00", "Variance"), scale.adj = TRUE, scale.00 = 2, paired = FALSE)
data.scale.xy(x, y, scale.option = c("Levene.Med.0", "Levene.Med", "Levene.Med.00", "Variance"), scale.adj = TRUE, scale.00 = 2, paired = FALSE)
x |
A vector specifying the first sample. |
y |
A vector specifying the second sample. |
scale.option |
A character string specifying the transformation on each observation; "Levene.med" for Levene's transformation (absolute difference from the sample median), "Levene.med.0" for Levene's transformation with zero removal for odd sample(s), "Levene.med.00" for Levene's transformation with zero removal for both odd and even sample(s), and "Variance" for squared difference from the sample mean. The default option is "Levene.med.0". |
scale.adj |
A boolean specifying whether or not any constant should be multiplied to each transformed observation. This is useful to obtain unbiased estimates. The default option is TRUE. |
scale.00 |
A scale to be applied for an even sample when "Levene.med.00" is chosen. The default option is 2, but the square root of 2 is another viable option. |
paired |
A boolean specifying whether or not the samples are paired or independent. The default option is FALSE. |
trans.x |
Transformed first sample. |
trans.y |
Transformed second sample. |
rho |
Sample correlation coefficient. For independent samples, it returns a NULL. |
set.seed(123) x<-runif(10) y<-runif(15) data.scale.xy(x, y, scale.option="Levene.Med.0", scale.adj=TRUE, paired=FALSE)
set.seed(123) x<-runif(10) y<-runif(15) data.scale.xy(x, y, scale.option="Levene.Med.0", scale.adj=TRUE, paired=FALSE)
Each subject is classified as female (=0) or male (=1). The variables are as follows:
subId: Subject IDs
gender: Grouping. Female=0 and Male=1
data(grouping)
data(grouping)
A data frame with 83 rows and 2 columns.
Lemm, K.M. (2006). Positive associations among interpersonal contact, motivation, and implicit and explicit attitudes toward gay men. Journal of Homosexuality 51:2, 79-99.
data(grouping)
data(grouping)
Log ratio analysis for the IAT.
logratio(rt, subject, block_type, trial_num, group, block_order = c("original", "reverse"), min_limit = 400, max_limit = 10000, rt_min = 200, correctvec = NULL, trace = FALSE)
logratio(rt, subject, block_type, trial_num, group, block_order = c("original", "reverse"), min_limit = 400, max_limit = 10000, rt_min = 200, correctvec = NULL, trace = FALSE)
rt |
A vector specifying all the reaction times. |
subject |
A vector specifying the subject IDs for the |
block_type |
A vector specifying the block type for the |
trial_num |
A vector specifying the trial number for each observation in the |
group |
A data frame with two columns specifying the subject IDs and corresponding group. There should be two groups. |
block_order |
A character string specifying the order of the two groups. There are two options: "original" puts the first group in the numerator of the ratio, and "reverse" puts the second group in the numerator of the ratio. |
min_limit |
A numeric specifying the lower limit for the reaction times to be included. The default option is 400. |
max_limit |
A numeric specifying the upper limit for the reaction times to be included. The default option is 10000. |
rt_min |
A numeric specifying the minimum time required for reaction. The default option is 200. |
correctvec |
A vector specifying whether or not the response is correct (0 for incorrect, 1 for correct). The default option is NULL, in which case, all the responses are assumed to be correct. |
trace |
A boolean specifying whether or not the progress should be displayed on the screen. The default option is FALSE. |
scores |
A list containing the IAT scores using the log ratio analysis. |
data(reactiontimes) data(grouping) rt <- reactiontimes$rt subject <- reactiontimes$subId block_type <- reactiontimes$block_type trial_num <- reactiontimes$trial_num block_order <- "reverse" results <- logratio(rt=rt, subject=subject, block_type=block_type, trial_num=trial_num, group=grouping, block_order=block_order, trace=TRUE) femaleRatioLog<-results$`0` maleRatioLog<-results$`1` two.sample.var(femaleRatioLog,maleRatioLog,alternative="two.sided", scale.option="Levene.Med.0",scale.adj=TRUE,paired=FALSE) Bonett.Seier.test(femaleRatioLog,maleRatioLog,alternative="two.sided")
data(reactiontimes) data(grouping) rt <- reactiontimes$rt subject <- reactiontimes$subId block_type <- reactiontimes$block_type trial_num <- reactiontimes$trial_num block_order <- "reverse" results <- logratio(rt=rt, subject=subject, block_type=block_type, trial_num=trial_num, group=grouping, block_order=block_order, trace=TRUE) femaleRatioLog<-results$`0` maleRatioLog<-results$`1` two.sample.var(femaleRatioLog,maleRatioLog,alternative="two.sided", scale.option="Levene.Med.0",scale.adj=TRUE,paired=FALSE) Bonett.Seier.test(femaleRatioLog,maleRatioLog,alternative="two.sided")
Each subject recorded one hundred RT observations for each of the two pairings (congruent vs. incongrunet). That is, in total, each subject has two hundred RT observations in total. The variables are as follows:
subId: Subject IDs
stim_pairing: Pairings of the stimulus.
block_type: Block type (gaygd or strgd).
trial_num: Trial number.
rt: Reaction time.
correct: Whether or not the response was correct (1=Correct, 0=Incorrect).
data(reactiontimes)
data(reactiontimes)
A data frame with 16600 rows and 6 columns.
Lemm, K.M. (2006). Positive associations among interpersonal contact, motivation, and implicit and explicit attitudes toward gay men. Journal of Homosexuality 51:2, 79-99.
data(reactiontimes)
data(reactiontimes)
Range-preserving two-sample t-test for comparing means.
two.sample.mean(x, y, transformation = c("none", "log", "logit"), alternative = c("two.sided", "less", "greater"), paired = FALSE, alpha = 0.05, plot.ci = TRUE, plot.ici = TRUE, ici.interval = NULL, add.individual.ci = TRUE, by.ici = 0.5, xlab.ici = "", rounds = 3, rounds.plot = NULL, ci.interval = NULL, by.ci = 0.5, name.x = NULL, name.y = NULL, pool.mean = FALSE, logit.interval = NULL, rho = NULL, tol = 1e-07)
two.sample.mean(x, y, transformation = c("none", "log", "logit"), alternative = c("two.sided", "less", "greater"), paired = FALSE, alpha = 0.05, plot.ci = TRUE, plot.ici = TRUE, ici.interval = NULL, add.individual.ci = TRUE, by.ici = 0.5, xlab.ici = "", rounds = 3, rounds.plot = NULL, ci.interval = NULL, by.ci = 0.5, name.x = NULL, name.y = NULL, pool.mean = FALSE, logit.interval = NULL, rho = NULL, tol = 1e-07)
x |
A vector specifying the first sample. |
y |
A vector specifying the second sample. |
transformation |
A character string specifying the transformation on the sample means; "none" for real-valued data, "log" for positive-valued data, and "logit" for data in a fixed interval. The default option is "none". |
alternative |
A character string specifying the alternative hypothesis; "two.sided" for two-tailed, "less" for left-tailed, and "greater" for right-tailed alternative hypothesis. The default option is "two.sided". |
paired |
A boolean specifying whether or not the samples are paired or independent. The default option is FALSE. |
alpha |
A numeric specifying the significance level. The default option is 0.05. |
plot.ci |
A boolean specifying whether or not the deviation between the two samples should be plotted. The default option is TRUE. |
plot.ici |
A boolean specifying whether or not the inferential confidence intervals for the two samples should be plotted. The default option is TRUE. |
ici.interval |
A vector with two elements specifying the range of values for the plot of inferential confidence intervals. The default option is NULL, in which case, an appropriate range is automatically specified. |
add.individual.ci |
A boolean specifying whether or not the confidence intervals with the confidence level implied by |
by.ici |
A numeric specifying te scales in the plot for ici.interval. The default option is 0.5. |
xlab.ici |
A character string specifying the x axis labels used for the inferential confidence intervals and confidence intervals. The default option is "". |
rounds |
A numeric specifying the number of decimal places to be rounded. The default option is 3. |
rounds.plot |
A numeric specifying the number of decimal places to be rounded. The default option is NULL, in which case it is set equal to |
ci.interval |
A vector with two elements specifying the range of values for the plot of confidence intervals. The default option is NULL, in which case, an appropriate range is automatically specified. |
by.ci |
A numeric specifying te scales in the plot for ci.interval. The default option is 0.5. |
name.x |
A character string specifying the label for the x variable. The default option is NULL, in which case, it is set to "x". |
name.y |
A character string specifying the label for the y variable. The default option is NULL, in which case, it is set to "y". |
pool.mean |
A boolean specifying whether or not the sample means should be pooled for the degrees of freedom. The default option is FALSE. |
logit.interval |
A vector with two elements specifying the lower and upper bound if logit transformation is used. The default option is NULL. |
rho |
A numeric specifying the correlation coefficient between the two samples. The default option is NULL, in which case, the sample correlation coefficient is estimated automatically. |
tol |
A numeric specifying the cut-off value for a numerical zero. The default option is 1e-7. |
CI |
A data frame displaying the effect size estimate, lower and upper bound of the effect size confidence interval, and the degrees of freedom. |
ICI |
A data frame displaying the sample mean for both x and y, lower and upper bounds of the inferential confidence intervals, the degrees of freedom of the inferential confidence intervals, the inferential significance level, and the significance level. |
Statistic |
A data frame displaying the test statistic and p-value of the generalized two-sample t-test. |
Ind.CI |
A data frame displaying the sample mean for both x and y, lower and upper bounds of the individual confidence intervals, the degrees of freedom of the individual confidence intervals, the sample standard deviations, and the significance level. |
Effect.Sizes |
A data frame displaying Cohen's d and either log ratio (for transformation="log") or log odds (for transformation="logit"). |
set.seed(123) x<-runif(10) y<-runif(15) two.sample.mean(x,y,"logit","two.sided",paired=FALSE, ici.interval=c(0,1), by.ici=0.2, logit.interval=c(0,1), rounds=2, name.x="xvar", name.y="yvar")
set.seed(123) x<-runif(10) y<-runif(15) two.sample.mean(x,y,"logit","two.sided",paired=FALSE, ici.interval=c(0,1), by.ici=0.2, logit.interval=c(0,1), rounds=2, name.x="xvar", name.y="yvar")
Two-sample t-test for comparing variability measures.
two.sample.var(x, y, alternative = c("two.sided", "less", "greater"), scale.option = c("Levene.Med", "Levene.Med.0", "Levene.Med.00", "Variance"), scale.adj = TRUE, scale.00 = 2, paired = FALSE, alpha = 0.05, plot.ci = TRUE, plot.ici = TRUE, ici.interval = NULL, add.individual.ci = TRUE, by.ici = 0.5, xlab.ici = "", rounds = 3, rounds.plot = NULL, ci.interval = NULL, by.ci = 0.5, name.x = NULL, name.y = NULL, pool.mean = FALSE, logit.interval = NULL, tol = 1e-07)
two.sample.var(x, y, alternative = c("two.sided", "less", "greater"), scale.option = c("Levene.Med", "Levene.Med.0", "Levene.Med.00", "Variance"), scale.adj = TRUE, scale.00 = 2, paired = FALSE, alpha = 0.05, plot.ci = TRUE, plot.ici = TRUE, ici.interval = NULL, add.individual.ci = TRUE, by.ici = 0.5, xlab.ici = "", rounds = 3, rounds.plot = NULL, ci.interval = NULL, by.ci = 0.5, name.x = NULL, name.y = NULL, pool.mean = FALSE, logit.interval = NULL, tol = 1e-07)
x |
A vector specifying the first sample. |
y |
A vector specifying the second sample. |
alternative |
A character string specifying the alternative hypothesis; "two.sided" for two-tailed, "less" for left-tailed, and "greater" for right-tailed alternative hypothesis. The default option is "two.sided". |
scale.option |
A character string specifying the transformation on each observation; "Levene.med" for Levene's transformation (absolute difference from the sample median), "Levene.med.0" for Levene's transformation with zero removal for odd sample(s), "Levene.med.00" for Levene's transformation with zero removal for both odd and even sample(s), and "Variance" for squared difference from the sample mean. The default option is "Levene.med.0". |
scale.adj |
A boolean specifying whether or not any constant should be multiplied to each transformed observation. This is useful to obtain unbiased estimates. The default option is TRUE. |
scale.00 |
A scale to be applied for an even sample when "Levene.med.00" is chosen. The default option is 2, but the square root of 2 is another viable option. |
paired |
A boolean specifying whether or not the samples are paired or independent. The default option is FALSE. |
alpha |
A numeric specifying the significance level. The default option is 0.05. |
plot.ci |
A boolean specifying whether or not the deviation between the two samples should be plotted. The default option is TRUE. |
plot.ici |
A boolean specifying whether or not the inferential confidence intervals for the two samples should be plotted. The default option is TRUE. |
ici.interval |
A vector with two elements specifying the range of values for the plot of inferential confidence intervals. The default option is NULL, in which case, an appropriate range is automatically specified. |
add.individual.ci |
A boolean specifying whether or not the confidence intervals with the confidence level implied by |
by.ici |
A numeric specifying te scales in the plot for ici.interval. The default option is 0.5. |
xlab.ici |
A character string specifying the x axis labels used for the inferential confidence intervals and confidence intervals. The default option is "". |
rounds |
A numeric specifying the number of decimal places to be rounded. The default option is 3. |
rounds.plot |
A numeric specifying the number of decimal places to be rounded. The default option is NULL, in which case it is set equal to |
ci.interval |
A vector with two elements specifying the range of values for the plot of confidence intervals. The default option is NULL, in which case, an appropriate range is automatically specified. |
by.ci |
A numeric specifying te scales in the plot for ci.interval. The default option is 0.5. |
name.x |
A character string specifying the label for the x variable. The default option is NULL, in which case, it is set to "x". |
name.y |
A character string specifying the label for the y variable. The default option is NULL, in which case, it is set to "y". |
pool.mean |
A boolean specifying whether or not the sample means should be pooled for the degrees of freedom. The default option is FALSE. |
logit.interval |
A vector with two elements specifying the lower and upper bound if logit transformation is used. The default option is NULL. |
tol |
A numeric specifying the cut-off value for a numerical zero. The default option is 1e-7. |
CI |
A data frame displaying the effect size estimate, lower and upper bound of the effect size confidence interval, and the degrees of freedom. |
ICI |
A data frame displaying the sample mean for both x and y, lower and upper bounds of the inferential confidence intervals, the degrees of freedom of the inferential confidence intervals, the inferential significance level, and the significance level. |
Statistic |
A data frame displaying the test statistic and p-value of the generalized two-sample t-test. |
Ind.CI |
A data frame displaying the sample mean for both x and y, lower and upper bounds of the individual confidence intervals, the degrees of freedom of the individual confidence intervals, the sample standard deviations, and the significance level. |
Effect.Sizes |
A data frame displaying Cohen's d and log ratio for the mean and variability measure comparisons. |
set.seed(123) x<-rexp(10) y<-rexp(15) two.sample.var(x,y,alternative="two.sided",scale.option="Levene.Med.0",scale.adj=TRUE,paired=FALSE)
set.seed(123) x<-rexp(10) y<-rexp(15) two.sample.var(x,y,alternative="two.sided",scale.option="Levene.Med.0",scale.adj=TRUE,paired=FALSE)