Jump to content

Wikipedia:Reference desk/Archives/Mathematics/2018 July 19

From Wikipedia, the free encyclopedia
Mathematics desk
< July 18 << Jun | July | Aug >> Current desk >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


July 19

[edit]

Students t-test check

[edit]

I have some data that I want to test for statistical significant difference. I wanted to use one tailed Student's t-test, two-sample equal variance (homoscedastic). I'm doing this in Excel. My p value is coming out at 0.3492. Is that correct? Is the difference really not statistically different? I was expecting it to be significant so I'm questioning whether I'm doing it right in Excel but it seems such a simple process.

Set 1:

0.00 0.00 0.00 0.00 0.55 0.37 0.00 0.00 0.465116279

Set 2:

2.631578947 4.332129964 1.923076923 5.179282869 7.142857143 4.867256637 5.339805825 3.286384977 3.2 --185.230.100.66 (talk) 15:01, 19 July 2018 (UTC)[reply]

R gives:

> a
[1] 0.0000000 0.0000000 0.0000000 0.0000000 0.5500000 0.3700000 0.0000000
[8] 0.0000000 0.4651163
> 
> b
[1] 2.631579 4.332130 1.923077 5.179283 7.142857 4.867257 5.339806 3.286385
[9] 3.200000
> t.test(a,b,var.equal=TRUE) 

Two Sample t-test

data:  a and b
t = -7.4596, df = 16, p-value = 1.357e-06
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -5.210546 -2.904400
sample estimates:
mean of x mean of y 
0.1539018 4.2113748 

that is a very small pvalue, but the repeated zeros make me suspicious that some of the assumptions under the t-test are not correct. HTH, Robinh (talk) 03:54, 20 July 2018 (UTC) >[reply]

The p-value should be 6.787e-07, but is not correct to use a t-test for this data. The data violates the normal distribution and equal variance assumptions.
@Robinh: you should specify the tail for a one-tailed t-test:
t.test(a, b, alternative="less", var.equal=TRUE)
C0617470r (talk) 08:03, 20 July 2018 (UTC)[reply]
@CR0617470: no, the OP specified "difference", which would indicate a two-sided test, which R does by default. Robinh (talk)
The OP explicitly asked for a one-tailed test. So there's room in this discussion for "here is how to do the calculation asked for in the OP" and also for "the calculation asked for in the OP is problematic and here are some resources for finding a better calculation to do," but there shouldn't be a place for "here is a different calculation from the one asked for in the OP that also is problematic." --JBL (talk) 15:41, 22 July 2018 (UTC)[reply]