I'm actually reading Andy Feld book and i'm trying to better understand how statistics works and especially t test.
I have two independent groups and i would like to compute 95% confidence interval in order to plot it as error bar on a bar plot graphic in R.
First would like to now my formula is correct. I have computed the standard error for each of my group and, as each group have a size of 12, i think i should refer to a student distribution (with a df of 11) in order to compute the lower and the upper bound and multiply this value with the SE. Is it right?
Thank you for your help
@BruceET thank you very much for your long and detailed comment :)
Maybe my problem wasn't clear enough. I already made a Welsh t-test to compare my two mean. The t test indicates that there is no significant difference between them.
Welch Two Sample t-test data: Anxiety by Group t = -1.7612, df = 21.246, p-value = 0.0926 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -16.168163 1.334829 sample estimates: mean in group Picture mean in group Real Spiders 40.00000 47.41667
What i want to do, is to plot the data and compute the 95% confidence interval as error bar. As you mantioned it, standard error of the mean seems to be a bad way to do it, so i would like to take good habits. :)
So, i want to know wich confidence interval i should plot. For me (but maybe i'm wrong, tis what i want to know), it doesn't make sense to plot the interval given by the Welsh T-test as it is the confidence interval for the distrbution of the mean of the difference between the two groups.
If i understand correclty, i should compute the confidence interval from the distribution of the mean for each of my group.
So for me it is something like this :
lower_bound_real <- - 1.7612 * sd(Real) / sqrt(length(Real)) upper_bound_real <- + 1.7612 * sd(Real) / sqrt(length(Real)) lower_bound_picture <- - 1.7612 * sd(Picture) / sqrt(length(Picture)) lower_bound_picture <- + 1.7612 * sd(Picture) / sqrt(length(Picture))
Is it right?
Also, if it is, i would loke to know how to plot a different error bar for each og the group on a same plot.
Concerning the "Notches", i'm not sure what it is? Is this the "error bar" of the boxplot? Also, it tell smothing about the difference of the medians, but not the means right?
Thank you one again