ifr_ts_ind_ttest
compares the means of two independent groups in order to determine whether
there is statistical evidence that the associated population means are significantly different.
ifr_ts_ind_ttest( data, x, y, confint = 0.95, alternative = c("both", "less", "greater", "all"), ... )
data | a data frame |
---|---|
x | factor; a column in |
y | numeric; a 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 |
... | additional arguments passed to or from other methods |
ifr_ts_ind_ttest
returns an object of class "ifr_ts_ind_ttest"
.
An object of class "ifr_ts_ind_ttest"
is a list containing the
following components:
levels of x
number of observations of y
for each level of x
total number of observations
mean of y
for each level of x
standard deviation of y
for each level of x
estimate of standard error of y
for each level of x
lower limit for the mean of y
for each level of x
upper limit for the mean of y
for each level of x
a data frame; mean, standard deviation, standard error and
confidence limit of mean of y
difference in mean of y
for the two groups of x
estimate of the standard error for difference in mean of
y
for the two groups of x
degrees of freedom
confidence interval for mean_diff
degrees of freedom for the pooled method
degrees of freedom for the Satterthwaite method
t statistic for the pooled method
t statistic for the Satterthwaite method
two-sided p-value for the pooled method
lower one-sided p-value for the pooled method
upper one-sided p-value for the pooled method
two-sided p-value for the Satterthwaite method
lower one-sided p-value for the Satterthwaite method
upper one-sided p-value for the Satterthwaite method
numerator degrees of freedom for folded f test
denominator degrees of freedom for folded f test
f value for the equality of variances test
p-value for the folded f test
name of y
confidence level
alternative hypothesis
ind_ttest()
has been deprecated. Instead use ifr_ts_ind_ttest()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
# lower tail ifr_ts_ind_ttest(hsb, female, write, alternative = 'less') #> Group Statistics #> ----------------------------------------------------------------------------- #> Group Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] #> ----------------------------------------------------------------------------- #> 0 91 50.121 1.080 10.305 47.97539 52.26661 #> 1 109 54.991 0.779 8.134 53.44689 56.53511 #> ----------------------------------------------------------------------------- #> combined 200 52.775 0.67 9.479 51.45379 54.09621 #> ----------------------------------------------------------------------------- #> diff 200 -4.87 1.304 9.231 -7.42623 -2.31377 #> ----------------------------------------------------------------------------- #> #> Independent Samples Test #> ------------------------ #> #> Ho: mean(0) - mean(1) = diff = 0 #> Ha: diff < 0 #> #> --------------------------------------------------------------------- #> Variable Method Variances DF t Value P < t #> --------------------------------------------------------------------- #> write Pooled Equal 198 -3.7341 0.0001 #> write Satterthwaite Unequal 170 -3.6564 0.0002 #> --------------------------------------------------------------------- #> #> Test for Equality of Variances #> --------------------------------------------------------------- #> Variable Method Num DF Den DF F Value P > F #> --------------------------------------------------------------- #> write Folded F 90 108 1.605 0.0188 #> --------------------------------------------------------------- # upper tail ifr_ts_ind_ttest(hsb, female, write, alternative = 'greater') #> Group Statistics #> ----------------------------------------------------------------------------- #> Group Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] #> ----------------------------------------------------------------------------- #> 0 91 50.121 1.080 10.305 47.97539 52.26661 #> 1 109 54.991 0.779 8.134 53.44689 56.53511 #> ----------------------------------------------------------------------------- #> combined 200 52.775 0.67 9.479 51.45379 54.09621 #> ----------------------------------------------------------------------------- #> diff 200 -4.87 1.304 9.231 -7.42623 -2.31377 #> ----------------------------------------------------------------------------- #> #> Independent Samples Test #> ------------------------ #> #> Ho: mean(0) - mean(1) = diff = 0 #> Ha: diff > 0 #> #> --------------------------------------------------------------------- #> Variable Method Variances DF t Value P > t #> --------------------------------------------------------------------- #> write Pooled Equal 198 -3.7341 0.9999 #> write Satterthwaite Unequal 170 -3.6564 0.9998 #> --------------------------------------------------------------------- #> #> Test for Equality of Variances #> --------------------------------------------------------------- #> Variable Method Num DF Den DF F Value P > F #> --------------------------------------------------------------- #> write Folded F 90 108 1.605 0.0188 #> --------------------------------------------------------------- # both tails ifr_ts_ind_ttest(hsb, female, write, alternative = 'both') #> Group Statistics #> ----------------------------------------------------------------------------- #> Group Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] #> ----------------------------------------------------------------------------- #> 0 91 50.121 1.080 10.305 47.97539 52.26661 #> 1 109 54.991 0.779 8.134 53.44689 56.53511 #> ----------------------------------------------------------------------------- #> combined 200 52.775 0.67 9.479 51.45379 54.09621 #> ----------------------------------------------------------------------------- #> diff 200 -4.87 1.304 9.231 -7.42623 -2.31377 #> ----------------------------------------------------------------------------- #> #> Independent Samples Test #> ------------------------ #> #> Ho: mean(0) - mean(1) = diff = 0 #> Ha: diff ~= 0 #> #> --------------------------------------------------------------------- #> Variable Method Variances DF t Value P > |t| #> --------------------------------------------------------------------- #> write Pooled Equal 198 -3.7341 0.0002 #> write Satterthwaite Unequal 170 -3.6564 0.0003 #> --------------------------------------------------------------------- #> #> Test for Equality of Variances #> --------------------------------------------------------------- #> Variable Method Num DF Den DF F Value P > F #> --------------------------------------------------------------- #> write Folded F 90 108 1.605 0.0188 #> --------------------------------------------------------------- # all tails ifr_ts_ind_ttest(hsb, female, write, alternative = 'all') #> Group Statistics #> ----------------------------------------------------------------------------- #> Group Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] #> ----------------------------------------------------------------------------- #> 0 91 50.121 1.080 10.305 47.97539 52.26661 #> 1 109 54.991 0.779 8.134 53.44689 56.53511 #> ----------------------------------------------------------------------------- #> combined 200 52.775 0.67 9.479 51.45379 54.09621 #> ----------------------------------------------------------------------------- #> diff 200 -4.87 1.304 9.231 -7.42623 -2.31377 #> ----------------------------------------------------------------------------- #> #> Independent Samples Test #> ------------------------ #> #> Ho: mean(0) - mean(1) = diff = 0 #> #> Ha: diff < 0 Ha: diff ~= 0 Ha: diff > 0 #> #> Pooled #> ------------------------------------------------------------------------ #> t = -3.7341 t = -3.7341 t = -3.7341 #> P < t = 0.0001 P > |t| = 0.0002 P > t = 0.9999 #> #> Satterthwaite #> ------------------------------------------------------------------------ #> t = -3.6564 t = -3.6564 t = -3.6564 #> P < t = 0.0002 P > |t| = 0.0003 P > t = 0.9998 #> #> #> Test for Equality of Variances #> --------------------------------------------------------------- #> Variable Method Num DF Den DF F Value P > F #> --------------------------------------------------------------- #> write Folded F 90 108 1.605 0.0188 #> ---------------------------------------------------------------