halo.data.biascorrection
Class RCorrelationCoefficient

java.lang.Object
  extended by halo.data.biascorrection.CorrelationCoefficient
      extended by halo.data.biascorrection.RCorrelationCoefficient

public class RCorrelationCoefficient
extends CorrelationCoefficient

An implementation to calculate the correlation coefficient from a tabular data file with R

Author:
Stefanie Kaufmann

Field Summary
static java.lang.String KENDAL
           
static java.lang.String PEARSON
           
static java.lang.String SPEARMAN
           
 
Constructor Summary
RCorrelationCoefficient(java.lang.String path, java.lang.String input)
          Constructs a new object for the calculation
 
Method Summary
 double calculateCorrelationCoefficient()
          Start the calculation of the correlation coefficient
 void readRResults()
          Parse the result from the output file
 void setFileName(java.lang.String fileName)
          Sets the name of the script file
 void setMethod(java.lang.String method)
          Sets the method for the calculation of the correlation coefficient
 void writeRScript()
          Writes the script for R to start the calculation of a correlation coefficient for the data and write the output into an output file
 
Methods inherited from class halo.data.biascorrection.CorrelationCoefficient
setInputFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PEARSON

public static final java.lang.String PEARSON
See Also:
Constant Field Values

KENDAL

public static final java.lang.String KENDAL
See Also:
Constant Field Values

SPEARMAN

public static final java.lang.String SPEARMAN
See Also:
Constant Field Values
Constructor Detail

RCorrelationCoefficient

public RCorrelationCoefficient(java.lang.String path,
                               java.lang.String input)
Constructs a new object for the calculation

Parameters:
path - The path of the R installation
input - The name of the file that holds the data table
Method Detail

writeRScript

public void writeRScript()
Writes the script for R to start the calculation of a correlation coefficient for the data and write the output into an output file


readRResults

public void readRResults()
Parse the result from the output file


calculateCorrelationCoefficient

public double calculateCorrelationCoefficient()
Start the calculation of the correlation coefficient

Specified by:
calculateCorrelationCoefficient in class CorrelationCoefficient
Returns:
The correlation coefficient for the data

setFileName

public void setFileName(java.lang.String fileName)
Sets the name of the script file

Parameters:
fileName - The name of the R script file

setMethod

public void setMethod(java.lang.String method)
Sets the method for the calculation of the correlation coefficient

Parameters:
method - The method for the calculation of the correlation coefficient; either 'pearson', 'kendal' or 'spearman' (default)