use of org.knime.core.data.DataCell in project knime-core by knime.
the class OneSampleTTestStatistics method getDescStats.
/**
* Get descriptive statistics for the given column
* @param rowID the row key
* @param column the name of the column
* @param stats the statistics of the column
* @param missing the missing values in this column
* @return a DataRow with descriptive statistics
*/
private List<DataCell> getDescStats(final String column, final SummaryStatistics stats, final MutableInteger missing) {
List<DataCell> cells = new ArrayList<DataCell>();
cells.add(new StringCell(column));
cells.add(new IntCell((int) stats.getN()));
cells.add(new IntCell(missing.intValue()));
cells.add(new DoubleCell(stats.getMean()));
cells.add(new DoubleCell(stats.getStandardDeviation()));
cells.add(new DoubleCell(StatsUtil.getStandardError(stats)));
return cells;
}
use of org.knime.core.data.DataCell in project knime-core by knime.
the class PairedTTestNodeModel method getDescriptiveStatisticsTable.
/**
* Get table with descriptive statistics
* @param result test statistic
* @param exec the exection context
* @return a combined table of the test statistic
*/
private BufferedDataTable getDescriptiveStatisticsTable(final PairedTTestStatistics[] result, final ExecutionContext exec) {
BufferedDataContainer cont = exec.createDataContainer(PairedTTestStatistics.getDescStatsSpec());
int r = 0;
for (int i = 0; i < result.length; i++) {
for (List<DataCell> cells : result[i].getDescStatsCells()) {
cont.addRowToTable(new DefaultRow(RowKey.createRowKey(r), cells));
r++;
}
}
cont.close();
return cont.getTable();
}
use of org.knime.core.data.DataCell in project knime-core by knime.
the class PairedTTestNodeModel method getTestStatisticsTable.
/**
* Get table with test statistics
* @param result test statistic
* @param exec the exection context
* @return a combined table of the test statistic
*/
private BufferedDataTable getTestStatisticsTable(final PairedTTestStatistics[] result, final ExecutionContext exec) {
BufferedDataContainer cont = exec.createDataContainer(PairedTTestStatistics.getTableSpec());
int r = 0;
for (int i = 0; i < result.length; i++) {
for (List<DataCell> cells : result[i].getTTestCells()) {
cont.addRowToTable(new DefaultRow(RowKey.createRowKey(r), cells));
r++;
}
}
cont.close();
return cont.getTable();
}
use of org.knime.core.data.DataCell in project knime-core by knime.
the class TwoSampleTTestNodeDialog method initGroupComboBoxes.
private void initGroupComboBoxes(final JComboBox groupOne) {
Object selected = groupOne.getSelectedItem();
groupOne.removeAllItems();
String col = m_groupingColumn.getSelectedColumn();
if (col != null && m_spec.containsName(col)) {
DataColumnSpec colSpec = m_spec.getColumnSpec(col);
DataColumnDomain domain = colSpec.getDomain();
if (domain.hasValues()) {
for (DataCell cell : domain.getValues()) {
groupOne.addItem(cell.toString());
}
} else if (domain.hasBounds()) {
groupOne.addItem(domain.getLowerBound().toString());
groupOne.addItem(domain.getUpperBound().toString());
}
}
groupOne.setSelectedItem(selected);
}
use of org.knime.core.data.DataCell in project knime-core by knime.
the class TwoSampleTTestNodeModel method getLeveneStatistices.
/**
* Get the table with the Levene-Test statistics
* @param leveneResult the Levene-Test results
* @param exec the execution context
* @return the table with the Levene-Test statistics
*/
private BufferedDataTable getLeveneStatistices(final LeveneTestStatistics[] leveneResult, final ExecutionContext exec) {
BufferedDataContainer cont = exec.createDataContainer(LeveneTestStatistics.getTableSpec());
int r = 0;
for (int i = 0; i < leveneResult.length; i++) {
for (List<DataCell> cells : leveneResult[i].getTTestCells()) {
cont.addRowToTable(new DefaultRow(RowKey.createRowKey(r), cells));
r++;
}
}
cont.close();
return cont.getTable();
}
Aggregations