# Conflicting Results from t-Test and Wilcoxon Signed Rank

##### New Member
Hi

I took before/after measurements of selected tree stems. The distribution looked normal so I used the paired t-Test. The results:

test statistic = 1.46
critical value = 1.69 (from table)

The instructions say if the test statistic < critical value there is no significant difference among the means (alpha = 0.05), and accept the null hypothesis.

I tried the same data on the Wilcoxon Signed Rank test which is to be used for non-parametric data, and the results:

test statistic = 189
critical value = 208 (alpha 0.05)

Only in this case the instructions say if the test statistic < critical value REJECT the null hypothesis.

Could you shed some light on this. Am I venturing into prohibited territory by using the wrong test i.e. Wilcoxon on parametric data? Also I've noted that critical values differ among different Wilcoxon tables found online. WT_? Is there a "certified" authentic table somewhere?

#### GretaGarbo

##### Human
It seems strange. Can you show us the data?

##### New Member
Hope this helps; the numbers are scrunched to the left.

Height to Top (ft)
Tree No. W/foliage W/out foliage
1 66 78
2
3
4 66 60
5
6
7
8
9
10 69 66
11 66 60
12 63 60
13 36 24
14
15
16 75 81
17 57 63
18
19
20
21
22
23
24
25 78 72
26
27
28
29
30 45 42
31 63 54
32 63 60
33 57 57
34 63 54
35 57 57
36
37
38 66 69
39
40 81 81
41
42
43
44 72 81
45
46
47 72 69
48 75 72
49 81 75
50
51 66 60
52 60 66
53 63 87
54
55 75 66
56 75 51
57 72 75
58 72 75
59 72 69
60 72 69
61 69 66
62 57 48
63
64 51 45
65 57 54
66 45 54
67 63 51
68 57 54

#### hlsmith

##### Not a robit
I have examined your post without too much scrutiny but will ask why are there gaps in your data file?

Also, which did you actually run:

Two sample ttest (difference in means)
One sample ttest (is mean of difference snot equal to "0")
Wilcoxon rank sum (non-parametric analog to two sample ttest)
Wilcoxon sign rank (non-parametric analog to one sample ttest)

Last edited:

#### GretaGarbo

##### Human
And where are the before/after measurements?

I thought that trees were higher with leafs (="foliage"?).

So are the number of pairs of observations about 38?

I don't understand the English expression: "the numbers are scrunched to the left."

EDIT
Hlsmith:
From the first post it seems to be paired t-Test and Wilcoxon Signed Rank test. But I also thought about that. That is why I wanted to re-run the data.

#### hlsmith

##### Not a robit
Sounds like Greta wants to go Bayesian on this with her prior beliefs. I will add that with leaves you have more growth but more weight (and gravity rules all). Also, if the measures were taken at two different time points, they aren't the same tree any more since it had the opportunity to live or die for a longer period then its younger self.

#### GretaGarbo

##### Human
her prior beliefs.
What?
It is not a prior. It is an empirical fact and a maximum likelihood estimate that in the summer there will be leafs (I hope I spell correctly) with high probability, and in the winter no leafs, also with high probability. Thus, no Bayesian prior.

Also I have the idea that a tree with leafs, which is an non-negative entity, will be taller than a tree without leafs. Also I believe that trees have the propensity to grow upwards in spite of gravity, although Newton made an observation about apples from trees tending to move downwards.

##### New Member
Gaps in data were not processed by Excel, they are trees I could not measure the second time.

I ran two-sample tests. First no. is tree no., second no. is measurement with foliage, third is after leaf fall. My hypothesis is that trees would be measured (with laser rangefinder) higher after leaf fall because tree top would not be obscured by leaves. Hlsmith has an interesting point though.

Measurements were taken about six weeks apart (before and after leaf fall).

You are right Greta, the mean was two feet higher BEFORE leaf fall, counter to my hypo. 37 observations, df = 36.

I should mention that for the t-test I used Excel data analysis; for the Wilcoxon test I followed the procedure at
.

If Greta wants to "go Bayesian" that's alright by me if she can explain it.

#### GretaGarbo

##### Human
Data:

Code:
# this is an R "program"
d <-
no leaf no_l
1 66 78
4 66 60
10 69 66
11 66 60
12 63 60
13 36 24
16 75 81
17 57 63
25 78 72
30 45 42
31 63 54
32 63 60
33 57 57
34 63 54
35 57 57
38 66 69
40 81 81
44 72 81
47 72 69
48 75 72
49 81 75
51 66 60
52 60 66
53 63 87
55 75 66
56 75 51
57 72 75
58 72 75
59 72 69
60 72 69
61 69 66
62 57 48
64 51 45
65 57 54
66 45 54
67 63 51
68 57 54
")
Code:
> t.test(d$leaf, d$no_l, paired = TRUE)

Paired t-test

data:  d$leaf and d$no_l
t = 1.4558, df = 36, p-value = 0.1541
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.7649608  4.6568527
sample estimates:
mean of the differences
1.945946

> wilcox.test(d$leaf, d$no_l, paired = TRUE)

Wilcoxon signed rank test with continuity correction

data:  d$leaf and d$no_l
V = 398, p-value = 0.08378
alternative hypothesis: true location shift is not equal to 0

Warning messages:
1: In wilcox.test.default(d$leaf, d$no_l, paired = TRUE) :
cannot compute exact p-value with ties
2: In wilcox.test.default(d$leaf, d$no_l, paired = TRUE) :
cannot compute exact p-value with zeroes
> wilcox.test(d$leaf, d$no_l, paired = TRUE,
+    alternative =  "greater" )

Wilcoxon signed rank test with continuity correction

data:  d$leaf and d$no_l
V = 398, p-value = 0.04189
alternative hypothesis: true location shift is greater than 0

Warning messages:
1: In wilcox.test.default(d$leaf, d$no_l, paired = TRUE, alternative = "greater") :
cannot compute exact p-value with ties
2: In wilcox.test.default(d$leaf, d$no_l, paired = TRUE, alternative = "greater") :
cannot compute exact p-value with zeroes
So we have the interesting result that it is not significant on the t-test. It is not significant in the paired Wilcoxon two-dided test. But it seems that the original poster want to use a one sided alternative ant then it IS significant.

Such a result is seldom seen. Interesting! Save it and use it as an education example.

#### hlsmith

##### Not a robit
How about trees without leaves may mean more dehydrated trees given seasonality in some locations.

P.S., tests are great and all, but you can't forget to plot data to visualize them.

##### New Member
Greta, are you saying that the YouTube guy is wrong in that he should have made a discrimination between one-tailed vs. two? And that your R program uses two-tailed and the result is same as my t-test? That is interesting.

I'm not gonna pretend I can read the R code since I'm not a programmer, and much prefer doing things in two-dimensional Excel spreadsheets. But I wonder where I can find a PROPER spreadsheet-based Wilcoxon test(?) Thanks for doing this.

##### New Member
Greta, are you saying that the YouTube guy is wrong in that he should have made a discrimination between one-tailed vs. two? And that your R program uses two-tailed and the result is same as my t-test? That is interesting.

I'm not gonna pretend I can read the R code since I'm not a programmer, and much prefer doing things in two-dimensional Excel spreadsheets. But I wonder where I can find a PROPER spreadsheet-based Wilcoxon test(?) Thanks for doing this.
Greta, BTW, can you explain the difference between one-tailed vs. two? I've read about it but I need someone to explain it in a different way.

Thanks, A.

##### New Member
How about trees without leaves may mean more dehydrated trees given seasonality in some locations.

P.S., tests are great and all, but you can't forget to plot data to visualize them.
But how is that related to height?

#### GretaGarbo

##### Human
Search the internet for one sided and two sided test. There are lots of texts. I did not look at the video. I would not trust it anyway. I definitely do not trust an spreadsheet program. Note that there are ties and excel and similar programs might go wrong there. Don't trust it!

But it is more important to look at the mean difference and a histogram. from the histogram it does not seems to be any difference.
"P.S., tests are great and all, but you can't forget to plot data to visualize them."

Look at the printed results. It should be quite obvious what is one sided etc.