SOCR EduMaterials AnalysesCommandLineMultiRegression

From Socr

(Difference between revisions)
Jump to: navigation, search
(Example Input data files: formatting)
(entered the new format of the MLR CSV interface as of July 2011)
 
Line 8: Line 8:
* The command-line interface to SOCR Analyses generally uses '''EXAMPLE 1''' from the list of example data files for the corresponding analysis.
* The command-line interface to SOCR Analyses generally uses '''EXAMPLE 1''' from the list of example data files for the corresponding analysis.
* All Input files are ASCII (see examples within each of the specific analyses).
* All Input files are ASCII (see examples within each of the specific analyses).
-
* a '''-h''' flag at the end of the command-line indicates that the first row in all ASCII input data files is a '''HEADER''' row (so it's not interpreted as data)
+
* a '''-h''' flag at the end of the command-line indicates that the first row in all ASCII input data files is a '''HEADER''' row (so it's not interpreted as data), use "-z" if there is no header.
-
* Number of variables can be indicated at the end (after '''-h''' flag). If no number of variables is specified, 3 is set as default.
+
* Independent Variables (predictors/regressors), and their interactions, are specified by: "-regressors Var1,Var2,Var3,Var1*Var2", and so on.
 +
* The Dependent (response) variable is specified by "-response ResponseVariable"
==Multiple Regression Usage==
==Multiple Regression Usage==
* Generic Setting:
* Generic Setting:
<code>
<code>
-
java -cp [SOCRjar_location]/SOCR_core.jar:[SOCRjar_location]/SOCR_plugin.jar edu.ucla.stat.SOCR.analyses.command.MultiRegressionCSV [data_location]/m.txt -h [number_of_variables]
+
java -cp [SOCRjar_location]/SOCR_core.jar:[SOCRjar_location]/SOCR_plugin.jar edu.ucla.stat.SOCR.analyses.command.MultiRegressionCSV [data_location]/m.txt -h -regressors Var1,Var2,Var3,Var1*Var2 -response ResponseVar
</code>
</code>
Line 22: Line 23:
<code>date</code>
<code>date</code>
-
<code>java -cp /ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/bin/SOCR_core.jar:/ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/bin/SOCR_plugin.jar edu.ucla.stat.SOCR.analyses.command.MultiRegressionCSV /ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/SOCR_CSV_test_Scripts_Data/m.txt -h 3</code>
+
<code>java -cp /ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/bin/SOCR_core.jar:/ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/bin/SOCR_plugin.jar edu.ucla.stat.SOCR.analyses.command.MultiRegressionCSV /ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/SOCR_CSV_test_Scripts_Data/m.txt -h regressors X,Y,X*Y -response Z</code>
<code>date</code>
<code>date</code>

Current revision as of 02:34, 27 July 2011

This page includes the information on how to access the Multiple Regression library via shell-based command-line interface on local machines. More information about other SOCR Analyses command-line interfaces is available here.

Contents

Introduction

In addition to the graphical user interfaces, via a web-browser, all SOCR Analyses allow command-line shell execution on local systems.

General Usage

  • Get the latest SOCR JAR files from the SOCR page (http://socr.ucla.edu/htmls/jars/).
  • The command-line interface to SOCR Analyses generally uses EXAMPLE 1 from the list of example data files for the corresponding analysis.
  • All Input files are ASCII (see examples within each of the specific analyses).
  • a -h flag at the end of the command-line indicates that the first row in all ASCII input data files is a HEADER row (so it's not interpreted as data), use "-z" if there is no header.
  • Independent Variables (predictors/regressors), and their interactions, are specified by: "-regressors Var1,Var2,Var3,Var1*Var2", and so on.
  • The Dependent (response) variable is specified by "-response ResponseVariable"

Multiple Regression Usage

  • Generic Setting:

java -cp [SOCRjar_location]/SOCR_core.jar:[SOCRjar_location]/SOCR_plugin.jar edu.ucla.stat.SOCR.analyses.command.MultiRegressionCSV [data_location]/m.txt -h -regressors Var1,Var2,Var3,Var1*Var2 -response ResponseVar

  • Example: Edit a new file (MultiRegressionCSV.csh) using any editor and paste this inside (make sure the file has executable permissions). Some operating systems/platforms may require variants of this (C-shell) script.

#!/bin/csh

date

java -cp /ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/bin/SOCR_core.jar:/ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/bin/SOCR_plugin.jar edu.ucla.stat.SOCR.analyses.command.MultiRegressionCSV /ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/SOCR_CSV_test_Scripts_Data/m.txt -h regressors X,Y,X*Y -response Z

date

exit

Example Input data files

One test datafile is included with the SOCR analyses command-line distribution (m.txt). The ASCII content of each of these is included below. Note that the first lines in these files are column headers. This requires the "-h" flag at the end of the command line execution so that these first lines are interpreted as column headers.

m.txt
x y z
968.0 158.0 64.0
43.0 11.0 0.4
588.0 91.0 12.0
640.0 92.0 34.0
4743.0 952.0 100.0
566.0 109.0 17.0
325.0 167.0 518.0
118.0 30.0 226.0
115.0 35.0 12524.0
1545.0 298.0 91.0
1302.0 203.0 68.0
262.0 41.0 8.1
2207.0 544.0 180.0
1410.0 254.0 129.0
833.0 150.0 49.0
669.0 136.0 27.0
911.0 147.0 76.0
1037.0 146.0 72.0
1196.0 46.0 31.0
616.0 157.0 314.0
766.0 255.0 655.0
2120.0 403.0 137.0
841.0 189.0 43.0
648.0 85.0 46.0
1289.0 234.0 63.0
259.0 38.0 4.6


Translate this page:

(default)

Deutsch

Español

Français

Italiano

Português

日本語

България

الامارات العربية المتحدة

Suomi

इस भाषा में

Norge

한국어

中文

繁体中文

Русский

Nederlands

Ελληνικά

Hrvatska

Česká republika

Danmark

Polska

România

Sverige

Personal tools