Could use some help with calculating stastical significance

BD2003

Lifer
Oct 9, 1999
16,815
1
81
I really, really need to compute p-values to determine statistical significance for my research paper. Its been years since I've done this and ever had to use it in class, and no one locally has a clue. I've a fairly good grip of the theory behind it so I'm not looking for an explanation behind it, but I need to select the proper test to calculate the values. I've got excel 2007, so if internal functions can be used, all the better. I've tried to figure it out on my own, but I'm completely lost and it absolutely must be correct, or else I'll get raped by the attendees when I present.

Several need to be calculated, but they all involve the same pattern.

The values are integers from 0-3, and the test is to determine if there is a statistically significant difference between the averages.

The number of samples for category A is 9, for category B is 6, and category C is 9. I can compare between just A and C if having the same sample size makes it absolutely necessary. The averages turned out being 2.42, 2.00 and 1.67, which seems pretty significant at face value, but I need to prove it.

The first involves just those three categories, although I can break it down into two if necessary.

Another has 5 categories of different sample sizes using the same 0-3 values, and it'd be a bit pointless without all 5, but I *need* to get at least the first one.

Thanks. :)
 

PlasmaBomb

Lifer
Nov 19, 2004
11,636
2
81
I have a stats package, but its too late now (nearly 2am here).
PM me with info (data, tests you want etc.) and I will have a look at it later.
 

Scarpozzi

Lifer
Jun 13, 2000
26,391
1,780
126
When you have different sample sizes like that, you have to compute a weighted average. It's been a couple of years for me too...I'm looking up some work I've done in the past if anything applies.
 
May 16, 2000
13,522
0
0
My advice is to download R (google it). It's just a few minutes to set it up and input the data, then a couple simple commands and it computes it all for you.
 

Paperdoc

Platinum Member
Aug 17, 2006
2,446
347
126
Please NOTE: Updated 2250 EDT June 3/08 to correct errors! Refer to Wikipedia article at:
Wikipedia on T-Test
and 1025 EDT June 4/08 for proper use of Std Error in last calc

The basic principle is this: you compare the DIFFERENCE between two means from two diffferent samples to the Standard Error for that difference statistic, and the ratio of difference to SE is the t-Score for a Student t-Test. In comparing two means, what you are doing really is testing the Null Hypothesis which says, "There is no significant difference (i.e., a Null difference) between these two means", and hoping that the t value obtained causes us to REJECT this Null Hypothesis. We would then conclude that the difference IS significant in statistical terms.

The general formula to calculate the Student t is:
t = {(Value) - (Reference Point)} / {S / Sqr Root of (n)} where n is the sample size, and S is the Standard Deviation of the sample for this statistic. In the t-Table, the Degrees of Freedom is (n-1). The denominator, which also is equal to {Sqr Root of (S^2 / n)}, is called the Standard Error for the statistic under study.

Then you look up the t-score in the standard tables for that Test and the right value of (n-1) (number of degrees of freedom) to find the related p-value.

The underlying assumption that you MUST be able to justify is that the two samples (or 3, or 5) really came from the same population and would show the same mean (except for the independent valiable that was changed) AND the same Standard Deviation. Then you can justify saying that, for each sample, its individual Standard Devaition is really just an independent estimate of the SAME Std Dev for the entire population. Then we make use of the fact that this also is the Standard Deviation for the DIFFERENCE between the means of any two samples taken from this population. And of course, you need to be able to justify the assumption that the data are distributed according the the "Normal Distribution" curve, because that is the mathematical model that produces the tools called Mean and Standard Deviation and t-Tests, etc. If the data distribution is NOT "Normal", you can't justify using the test tools.

Now, how do we estimate the Standard Deviation for ALL the samples assuming we have satisfied ourselves that it really is all the same group and there is only one Std Dev to use? If you are comparing two samples of the same size, the intuitive step - just average the two - is correct. But if you have different sample sizes, you must calculate a weighted average. In doing so, though, you must take into account the fact that Std Dev is calcualted with an (n-1) factor in the denominator. Assume we have samples 1 and 2, each with means M and Std Dev's S. The Pooled Estimate of Std Dev for the difference statistic (M1-M2) is given by

S(pool) = Square Root of {[(n1-1)s1^2 + (n2-1)s2^2] / (n1 + n2 - 2)}

For the calulation of t, the Standard Error (which is simply {Sqr Root of (S^2 / n)} for the simplest case, now becomes

SE = Square Root of {[(n1-1)s1^2 + (n2-1)s2^2] x [1/n1 + 1/n2] / (n1 + n2 - 2)}

Then we calculate t for the difference as (M1-M2)/SE and check the tables. In doing so, the number of degrees of freedom, n, to use in the table is (n1 + n2 - 2).

Now, your situation is a little trickier. Take the first case where there are three sample groups. You could compare Samples 1 and 2 as above, then redo it all for 2 vs. 3, then another for 1 vs. 3. In each case you would calculate separately an estimate of Pooled Std Dev. But the original basis we hope to have satisfied is that all three values of Std. Dev. are, in fact, estimates of the SAME real population Std. Dev. So we should be able to calculate ONE estimate of Std. Dev. and use it for all three comparisons. Extending the principle of weighted averages as above, we will calculate

S(Pool) = Square Root of {[(n1-1)S1^2 + (n2-1)S2^2 + (n3-1)S3^2] / (n1 + n2 + n3 - 3)}

Now use that one value of Pooled Std Dev estimate in the denominator of all three calculations for the ratio t = (Sample Mean Difference) / SE. Note that we can calculate a pooled estimate of Std Dev for the population this way, but there is no "Pooled Standard Error". The Standard Error for the particular statistic we are examining in any one case (in these cases, we're examining the difference between means of two samples) is calculated from the Pooled Estimate of Std Dev and the number of observations involved in each comparison, thusly:

SE (for Sample 1 vs. Sample 2) = S(Pool) x Sqr Root of (1/n1 + 1/n2)

and hence to get the t value for this difference, t = (M1 - M2) / SE (for 1 vs. 2), or

t (for 1 vs. 2) = {M1 - M2} / {S (Pool) x [Sqr Root of (1/n1 + 1/n2)]}

This time as you look at the t-Table, remember that the Degrees of Freedom for the difference statistic is still (n1 + n2 - 2) because you are making a comparison of only 2 samples. Use the same procedure each time for comparing M1 vs. M3, and M2 vs. M3, putting in the appropriate values of n1, n2 and n3.

Apply a similar procedure to comparing the five samples in the second experiment.

By the way, to be even more rigorous and avoid trying to justify the assumption that the first three samples all came from a population with one and the same Std Dev, I remember in a earlier version of Excel finding a Function that would assume that two Std Devs (from two samples being compared) were NOT that same and calculate a Pooled SE estimate for the t-Test in a different way, but I really do not understand the statistical background to that procedure. The Wikipedia article above shows this as Welch's t Test.
 

Paperdoc

Platinum Member
Aug 17, 2006
2,446
347
126
Originally posted by: Vincent
You need to carry out an ANOVA. Here is one website that describes what to do:

http://www.isixsigma.com/library/content/c021111a.asp

Usually an ANOVA will tell you whether the variances among the separate samples in a multi-sample data set are significant or not. In your first case, an ANOVA can tell you whether there is a significant difference somewhere among the three groups, but not exactly where. If the answer is yes, then you still need to carry out individual t-Tests between pairings of samples to determine whether Sample 1 is different from Sample 2, whether 2 differs from 3, and whether 1 differs from 3.

I am sure an ANOVA procedure is easier if your samples are all the same size; I don't remember whether you can do it for different sample sizes, but surely there must be a way.
 

BD2003

Lifer
Oct 9, 1999
16,815
1
81
Thanks for the help everyone, the ANOVA seemed to do the trick.

Thanks again. :)
 

Paperdoc

Platinum Member
Aug 17, 2006
2,446
347
126
I'm always reminded of a quote in an old stats book, "Facts from Figures", attributed to Disraeli, I think:

There are lies, damned lines, and statistics!