Source code

Download source archive ↓

upstream-extended/community/tools/rpy_statistics_collection/linear_regression.xml

1<tool id="LinearRegression1" name="Perform Linear Regression" version="1.1.0">
2  <description> </description>
3  <macros>
4      <import>statistic_tools_macros.xml</import>
5  </macros>
6  <expand macro="requirements" />
7  <command interpreter="python">
8<![CDATA[
9    linear_regression.py
10      $input1
11      $response_col
12      $predictor_cols
13      $out_file1
14      $out_file2
15      1>/dev/null
16]]>
17  </command>
18  <inputs>
19    <param format="tabular" name="input1" type="data" label="Select data" help="Dataset missing? See TIP below."/>
20    <param name="response_col" label="Response column (Y)" type="data_column" data_ref="input1" numerical="True"/>
21    <param name="predictor_cols" label="Predictor columns (X)" type="data_column" data_ref="input1" numerical="True" multiple="true" >
22        <validator type="no_options" message="Please select at least one column."/>
23    </param>
24  </inputs>
25  <outputs>
26    <data format_source="input" name="out_file1" metadata_source="input1" />
27    <data format="pdf" name="out_file2" />
28  </outputs>
29  <tests>
30    <test>
31        <param name="input1" value="regr_inp.tabular"/>
32        <param name="response_col" value="3"/>
33        <param name="predictor_cols" value="1,2"/>
34        <output name="out_file1" file="regr_out.tabular"/>
35        <output name="out_file2" file="regr_out.pdf"/>
36    </test>
37  </tests>
38  <help>
39<![CDATA[
40
41
42.. class:: infomark
43
44**TIP:** If your data is not TAB delimited, use *Edit Datasets->Convert characters*
45
46-----
47
48.. class:: infomark
49
50**What it does**
51
52This tool uses the 'lm' function from R statistical package to perform linear regression on the input data. It outputs two files, one containing the summary statistics of the performed regression, and the other containing diagnostic plots to check whether model assumptions are satisfied.
53
54*R Development Core Team (2009). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. ISBN 3-900051-07-0, URL http://www.R-project.org.*
55
56-----
57
58.. class:: warningmark
59
60**Note**
61
62- This tool currently treats all predictor and response variables as continuous numeric variables. Running the tool on categorical variables might result in incorrect results.
63
64- Rows containing non-numeric (or missing) data in any of the chosen columns will be skipped from the analysis.
65
66- The summary statistics in the output are described below:
67
68  - sigma: the square root of the estimated variance of the random error (standard error of the residiuals)
69  - R-squared: the fraction of variance explained by the model
70  - Adjusted R-squared: the above R-squared statistic adjusted, penalizing for the number of the predictors (p)
71  - p-value: p-value for the t-test of the null hypothesis that the corresponding slope is equal to zero against the two-sided alternative.
72
73
74]]>
75  </help>
76  <expand macro="citations" />
77</tool>