ifr_ts_paired_ttest
tests that two samples have the
same mean, assuming paired data.
ifr_ts_paired_ttest( data, x, y, confint = 0.95, alternative = c("both", "less", "greater", "all") )
data | a |
---|---|
x | numeric; column in |
y | numeric; column in |
confint | confidence level |
alternative | a character string specifying the alternative hypothesis, must be one of "both" (default), "greater", "less" or "all". You can specify just the initial letter. |
ifr_ts_paired_ttest
returns an object of class "ifr_ts_paired_ttest"
.
An object of class "ifr_ts_paired_ttest"
is a list containing the
following components:
number of observations
mean, standard deviation and standard error of x
, y
and their difference
t statistic
lower one-sided p-value
upper one-sided p-value
two sided p-value
Correlation of x
and y
p-value of correlation test
confidence interval for mean of x
confidence interval for mean of y
confidence interval for mean of difference of x
and y
degrees of freedom
confidence level
alternative hypothesis
names of x
and y
string used in printing results of the test
paired_ttest()
has been deprecated. Instead use
ifr_ts_paired_ttest()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
# lower tail ifr_ts_paired_ttest(hsb, read, write, alternative = 'less') #> Paired Samples Statistics #> ---------------------------------------------------------------------------- #> Variables Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] #> ---------------------------------------------------------------------------- #> read 200 52.23 0.7249921 10.25294 50.8 53.66 #> write 200 52.775 0.6702372 9.478586 51.45 54.1 #> ---------------------------------------------------------------------------- #> diff 200 -0.545 0.6283822 8.886666 -1.78 0.69 #> ---------------------------------------------------------------------------- #> #> Paired Samples Correlations #> ------------------------------------------- #> Variables Obs Correlation Sig. #> read & write 200 0.60 0 #> ------------------------------------------- #> #> Paired Samples Test #> ------------------- #> Ho: mean(read - write) = 0 #> Ha: mean(read - write) < 0 #> #> ---------------------------------------- #> Variables t df Sig. #> ---------------------------------------- #> read - write -0.8673 199 0.193 #> ---------------------------------------- # upper tail ifr_ts_paired_ttest(hsb, read, write, alternative = 'greater') #> Paired Samples Statistics #> ---------------------------------------------------------------------------- #> Variables Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] #> ---------------------------------------------------------------------------- #> read 200 52.23 0.7249921 10.25294 50.8 53.66 #> write 200 52.775 0.6702372 9.478586 51.45 54.1 #> ---------------------------------------------------------------------------- #> diff 200 -0.545 0.6283822 8.886666 -1.78 0.69 #> ---------------------------------------------------------------------------- #> #> Paired Samples Correlations #> ------------------------------------------- #> Variables Obs Correlation Sig. #> read & write 200 0.60 0 #> ------------------------------------------- #> #> Paired Samples Test #> ------------------- #> Ho: mean(read - write) = 0 #> Ha: mean(read - write) > 0 #> #> ---------------------------------------- #> Variables t df Sig. #> ---------------------------------------- #> read - write -0.8673 199 0.807 #> ---------------------------------------- # both tails ifr_ts_paired_ttest(hsb, read, write, alternative = 'both') #> Paired Samples Statistics #> ---------------------------------------------------------------------------- #> Variables Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] #> ---------------------------------------------------------------------------- #> read 200 52.23 0.7249921 10.25294 50.8 53.66 #> write 200 52.775 0.6702372 9.478586 51.45 54.1 #> ---------------------------------------------------------------------------- #> diff 200 -0.545 0.6283822 8.886666 -1.78 0.69 #> ---------------------------------------------------------------------------- #> #> Paired Samples Correlations #> ------------------------------------------- #> Variables Obs Correlation Sig. #> read & write 200 0.60 0 #> ------------------------------------------- #> #> Paired Samples Test #> ------------------- #> Ho: mean(read - write) = 0 #> Ha: mean(read - write) ~= 0 #> #> ---------------------------------------- #> Variables t df Sig. #> ---------------------------------------- #> read - write -0.8673 199 0.387 #> ---------------------------------------- # all tails ifr_ts_paired_ttest(hsb, read, write, alternative = 'all') #> Paired Samples Statistics #> ---------------------------------------------------------------------------- #> Variables Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] #> ---------------------------------------------------------------------------- #> read 200 52.23 0.7249921 10.25294 50.8 53.66 #> write 200 52.775 0.6702372 9.478586 51.45 54.1 #> ---------------------------------------------------------------------------- #> diff 200 -0.545 0.6283822 8.886666 -1.78 0.69 #> ---------------------------------------------------------------------------- #> #> Paired Samples Correlations #> ------------------------------------------- #> Variables Obs Correlation Sig. #> read & write 200 0.60 0 #> ------------------------------------------- #> #> Ho: mean(read - write) = mean(diff) = 0 #> #> Ha: mean(diff) < 0 Ha: mean(diff) ~= 0 Ha: mean(diff) > 0 #> t = -0.8673 t = -0.8673 t = -0.8673 #> P < t = 0.193 P > |t| = 0.387 P > t = 0.807