comparison cor.xml @ 0:ffcdde989859 draft

Uploaded
author iuc
date Tue, 29 Jul 2014 06:30:45 -0400
parents
children 2e7bc1bb2dbe
comparison
equal deleted inserted replaced
-1:000000000000 0:ffcdde989859
1 <tool id="cor2" name="Correlation" version="1.1.0">
2 <description>for numeric columns</description>
3 <expand macro="requirements" />
4 <macros>
5 <import>statistic_tools_macros.xml</import>
6 </macros>
7 <command interpreter="python">cor.py $input1 $out_file1 $numeric_columns $method</command>
8 <inputs>
9 <param format="tabular" name="input1" type="data" label="Dataset" help="Dataset missing? See TIP below"/>
10 <param name="numeric_columns" label="Numerical columns" type="data_column" numerical="True" multiple="True" data_ref="input1" help="Multi-select list - hold the appropriate key while clicking to select multiple columns" />
11 <param name="method" type="select" label="Method">
12 <option value="pearson">Pearson</option>
13 <option value="kendall">Kendall rank</option>
14 <option value="spearman">Spearman rank</option>
15 </param>
16 </inputs>
17 <outputs>
18 <data format="txt" name="out_file1" />
19 </outputs>
20 <tests>
21 <!--
22 Test a tabular input with the first line being a comment without a # character to start
23 -->
24 <test>
25 <param name="input1" value="cor.tabular" />
26 <param name="numeric_columns" value="2,3" />
27 <param name="method" value="pearson" />
28 <output name="out_file1" file="cor_out.txt" />
29 </test>
30 </tests>
31 <help>
32
33 .. class:: infomark
34
35 **TIP:** If your data is not TAB delimited, use *Text Manipulation-&gt;Convert*
36
37 .. class:: warningmark
38
39 Missing data ("nan") removed from each pairwise comparison
40
41 -----
42
43 **Syntax**
44
45 This tool computes the matrix of correlation coefficients between numeric columns.
46
47 - All invalid, blank and comment lines are skipped when performing computations. The number of skipped lines is displayed in the resulting history item.
48
49 - **Pearson's Correlation** reflects the degree of linear relationship between two variables. It ranges from +1 to -1. A correlation of +1 means that there is a perfect positive linear relationship between variables. The formula for Pearson's correlation is:
50
51 .. image:: $PATH_TO_IMAGES/pearson.png
52
53 where n is the number of items
54
55 - **Kendall's rank correlation** is used to measure the degree of correspondence between two rankings and assessing the significance of this correspondence. The formula for Kendall's rank correlation is:
56
57 .. image:: $PATH_TO_IMAGES/kendall.png
58
59 where n is the number of items, and P is the sum.
60
61 - **Spearman's rank correlation** assesses how well an arbitrary monotonic function could describe the relationship between two variables, without making any assumptions about the frequency distribution of the variables. The formula for Spearman's rank correlation is
62
63 .. image:: $PATH_TO_IMAGES/spearman.png
64
65 where D is the difference between the ranks of corresponding values of X and Y, and N is the number of pairs of values.
66
67 -----
68
69 **Example**
70
71 - Input file::
72
73 #Person Height Self Esteem
74 1 68 4.1
75 2 71 4.6
76 3 62 3.8
77 4 75 4.4
78 5 58 3.2
79 6 60 3.1
80 7 67 3.8
81 8 68 4.1
82 9 71 4.3
83 10 69 3.7
84 11 68 3.5
85 12 67 3.2
86 13 63 3.7
87 14 62 3.3
88 15 60 3.4
89 16 63 4.0
90 17 65 4.1
91 18 67 3.8
92 19 63 3.4
93 20 61 3.6
94
95 - Computing the correlation coefficients between columns 2 and 3 of the above file (using Pearson's Correlation), the output is::
96
97 1.0 0.730635686279
98 0.730635686279 1.0
99
100 So the correlation for our twenty cases is .73, which is a fairly strong positive relationship.
101 </help>
102 </tool>