# Test data for differences

I am trying to figure out the best way to test my data for differences in R. The data I have look like this:

domain               variable    lifecycle
162                      CSP1         5
162               old Species        10
162                        BD        16
162                       DBH        14
162                    Height        16
162           Height comments        16
162            Other comments         4
162                      Year         5
123                   species        12
123                  den bran        14
123                  den core        14
191                      CSP2         4
191                   C kg ha         5
185                  location         5
185                   biomass         6
82                   CSP num         6
82                  depth lb         8
82                       C t         7
190                     Layer         8
190                Dry weight         9
204                 item plot         5
204               item volume         7
204 within central plot small         7
205                      plot         3
205        successional stage         3
205            rarefy hundred         3


Now I want to use the "variable" column as factorial group and the "lifecycle" as the characteristiom to compare. Because the data is not normally distributed and I have more than two groups to compare I chose a Kruskal-Wallis test, which shows no significant differences.

Kruskal-Wallis rank sum test

data:  lifecycle by variable
Kruskal-Wallis chi-squared = 25, df = 25, p-value = 0.4624


My question is now if I can use the Kruskal-Wallis in this case to find differences in "lifecycle" for the "variable" groups, or is the sample size to small with only one value per group?

And if it is not usable here in this case what would be a better solution?

EDIT:

I did the Kruskal-Wallis now with the domain as grouping factor. Which gives me a significant difference. The interpretation would be that there are domains with significant more or less impact than other.

After that I performed a post-hoc test to see between which of the domains the differences occur. But supprisingly the paired wilcoxon test with bonferroni correction showed up no significant grup differences. How could this be?

-
I think you have some big troubles on you data. What hypothesis are you trying to test?, what is your response variable? what does life cycle means? (I am a biologist but it is not clear in your data). You have many categories on the "variable" groups (some of them are non-sense), what about replicates?, as stated you have no replicates?. Please REVISE the WHOLE DESIGN of your study. It is not clear at all. –  Damian Aug 13 '12 at 14:53
This data is an analysis about a scientific workflow created with the workflow software Kepler. Could be that the name "lifecycle" is a bit missleading and to call it "Impact Factor" would be better I guess. The "Impact factor" describes a count of how much Influence a Variable has on other components of a scientific workflow. The hypothesis would be: There are variables with a significant higher impact factor than others in an scientific workflow. The response would be the count of workflow parts the variable affects. Best Sab –  user1554736 Aug 13 '12 at 15:22

Damian is correct that you need to look much more closely at what your question is conceptually before we can address this. If the table you have displayed represents the entirety of your data, applying statistics makes no sense because there is no variability present within your categories. Each category is entirely described by one score. The Kruskal-Wallis test asks whether groups differ in their median values. With only one score this question is meaningless.

-
He, thanks for the answer. Ok thats good to know that I can not do this with only one value per group. That makes sense that there is no variance. You say it compares the medians of the values? I thought it compares the rank sums? So it schould work then if I use the column "domain" as grouping factor. This represents the dataset the variables belong to. Then I could check for differences in between the datasets, asking if there is a difference in variable impact factor ("lifecycle") between the datasets. –  user1554736 Aug 13 '12 at 20:32
The Kruskaal-Wallis test is computed using rank sums. The hypotheses that you are testing however are: null, the k population distribution functions are identical; alternative, the k populations do not all have the same median. See Applied Nonparametric Statitics Chapter 6 for more details. I'm not sure I understand what you mean by 'dataset' but your assessment is correct. –  Marcus Morrisey Aug 14 '12 at 17:58
Ok thats good. And have you any Idea about the different results the tests give me which I posted as edit? The Kruskal Wallis now says: There is a significant difference. But when I test for detailed differences in a pariwise Wilcoxon test with p-value estimation and a Bonferroni correction there are no differences. How could I report this. What is the right interpretation then? Best Sab. –  user1554736 Aug 15 '12 at 10:52