use of org.knime.core.data.DataCell in project knime-core by knime.
the class OneWayANOVAStatistics method getTTestTable.
/**
* Get the test result of the t-test, for the assumption of equal
* variance and the assumption of unequal variances.
* @param exec the execution context
* @return the t-test results
*/
public BufferedDataTable getTTestTable(final ExecutionContext exec) {
DataTableSpec outSpec = getTableSpec();
BufferedDataContainer cont = exec.createDataContainer(outSpec);
int r = 0;
for (List<DataCell> cells : getTTestCells()) {
cont.addRowToTable(new DefaultRow(RowKey.createRowKey(r), cells));
r++;
}
cont.close();
BufferedDataTable outTable = cont.getTable();
return outTable;
}
use of org.knime.core.data.DataCell in project knime-core by knime.
the class OneWayANOVAStatistics method getGroupsTotalStatistics.
/**
* Get descriptive statistics for all groups.
* @return the descriptive statistics for all groups
*/
public List<DataCell> getGroupsTotalStatistics() {
List<DataCell> cells = new ArrayList<DataCell>();
cells.add(new StringCell(m_column));
cells.add(new StringCell("Total"));
SummaryStatistics stats = m_stats;
cells.add(new IntCell((int) stats.getN()));
int missingCount = 0;
for (MutableInteger m : m_missing) {
missingCount += m.intValue();
}
cells.add(new IntCell(missingCount));
cells.add(new IntCell(m_missingGroup.intValue()));
cells.add(new DoubleCell(stats.getMean()));
cells.add(new DoubleCell(stats.getStandardDeviation()));
cells.add(new DoubleCell(StatsUtil.getStandardError(stats)));
cells.add(new DoubleCell(m_confidenceIntervalProp));
long df = stats.getN() - 1;
TDistribution distribution = new TDistribution(df);
double tValue = FastMath.abs(distribution.inverseCumulativeProbability((1 - m_confidenceIntervalProp) / 2));
double confidenceDelta = tValue * StatsUtil.getStandardError(stats);
double confidenceLowerBound = stats.getMean() - confidenceDelta;
double confidenceUpperBound = stats.getMean() + confidenceDelta;
cells.add(new DoubleCell(confidenceLowerBound));
cells.add(new DoubleCell(confidenceUpperBound));
cells.add(new DoubleCell(stats.getMin()));
cells.add(new DoubleCell(stats.getMax()));
return cells;
}
use of org.knime.core.data.DataCell in project knime-core by knime.
the class OneWayANOVAStatistics method getTotal.
/**
* Get the row of the ANOVA table with the cells "Total".
*/
private List<DataCell> getTotal(final ANOVA anova) {
List<DataCell> cells = new ArrayList<DataCell>();
cells.add(new StringCell(m_column));
cells.add(new StringCell(SOURCE_TOTAL));
cells.add(new DoubleCell(anova.getSqurb() + anova.getSquri()));
cells.add(new IntCell((int) (anova.getDfb() + anova.getDfi())));
cells.add(DataType.getMissingCell());
cells.add(DataType.getMissingCell());
cells.add(DataType.getMissingCell());
return cells;
}
use of org.knime.core.data.DataCell in project knime-core by knime.
the class OneSampleTTestStatistics method getTTestTable.
/**
* Get the test result of the t-test, for the assumption of equal
* variance and the assumption of unequal variances.
* @param exec the execution context
* @return the t-test results
*/
public BufferedDataTable getTTestTable(final ExecutionContext exec) {
DataTableSpec outSpec = getTableSpec();
BufferedDataContainer cont = exec.createDataContainer(outSpec);
int r = 0;
for (List<DataCell> cells : getTTestCells()) {
cont.addRowToTable(new DefaultRow(RowKey.createRowKey(r), cells));
r++;
}
cont.close();
BufferedDataTable outTable = cont.getTable();
return outTable;
}
use of org.knime.core.data.DataCell in project knime-core by knime.
the class OneSampleTTestStatistics method getDescStatsTable.
/**
* Get descriptive statistics
* @param exec
* @return the descriptive statistics for each column test column
*/
public BufferedDataTable getDescStatsTable(final ExecutionContext exec) {
DataTableSpec outSpec = getDescStatsSpec();
BufferedDataContainer cont = exec.createDataContainer(outSpec);
int r = 0;
for (List<DataCell> cells : getDescStatsCells()) {
cont.addRowToTable(new DefaultRow(RowKey.createRowKey(r), cells));
r++;
}
cont.close();
BufferedDataTable outTable = cont.getTable();
return outTable;
}
Aggregations