Difference between revisions of "BarTab"

From MagnetoWiki
Jump to navigation Jump to search
 
Line 31: Line 31:
 
::LineOfCells *row, *column;  
 
::LineOfCells *row, *column;  
  
:::// this cell belows to this row and this column
+
:::// this cell belongs to this row and this column
  
 
:::// so it is the intersection of this row and column
 
:::// so it is the intersection of this row and column
Line 64: Line 64:
  
 
</code>
 
</code>
 +
 
==LineOfCells==
 
==LineOfCells==
  

Revision as of 21:52, 21 November 2006

BarTab Program description

BarTab is under development.

BarTab is a small application designed to run 1-way or 2-way ANOVAs with repeated measures on relatively small data sets. A number posthoc tests will also be provided. BarTab was designed to analyze the intake data collected in my lab, which typically consists of intake of 2-6 groups (with 6-8 animals per group) across 1 to 14 days of testing. (The intake data is collected from bar-coded bottles and food jars by the BarTender program). It also fills a hole in available small statistical packages, which either do not offer 2-way repeated measures ANOVAs or do not provide a selection of posthoc tests that can be applied to make arbitrary among-group comparisons.

The ANOVA calculation in BarTab are based on cells of data organized in a two dimension array of rows and columns (the number of cells is equal to the number of rows X the number of columns). The rows represent the groups of the first factor, and the columns represent the groups of the second factor (e.g., if factor 2 is time, then the columns are consecutive days of data collection). Each cell contains the data observations for a particular group of factor 1 at a particular treatment of factor 2 (e.g. in a Drug X Time ANOVA, a cell might be the intakes of the 38mg/kg-treated group on day 3 of intake testing).


Statistical References

I will list here the books and equations that were used in the programming of BarTab.

BarTab Objects and Data Structures

DataCell

The DataCell object is the atomic unit in BarTab. It represents an intersection of the two factors in a 2-way ANOVA (i.e. the data from Group 2 on Day 5 in a Group X Day ANOVA) or the data from one group in a 1-way ANOVA. The DataCell contains an array of real numbers which are the data from each individual subject in that cell (“observations”). (In other words, BarTab doesn’t track the data from individual subjects, but deals with the collected data within each cell of an ANOVA.

In addition to the data from each individual, each DataCell precalculates the sum, mean, variance, and standard deviation

Declaration

class DataCell:public Object {

public:
AnovaDataSet *data_set; // belongs to this AnovaDataSet
Boolean missing; // TRUE if this cell is not represented...
LineOfCells *row, *column;
// this cell belongs to this row and this column
// so it is the intersection of this row and column
unsigned long n; // number of observations in this cell (X)
double *observations; // array of observation values
unsigned long arraySize; // current size of the array
double total; // sum of all observations in this cell
double mean; // mean of all observations in this cell
double unbiased_variance; // sum of squares of observations divided by n-1
double biased_variance; // sum of squares of observations divided by n
double deviation; // unbiased standard deviation
DataCell(); // constructor to make the cell;
//initializes the array of observations to CELL_PAGE_SIZE
~DataCell(); // destructor that deallocates the array of observations
void AddObservation(double datum); // set the i-th observation to this value
void Update(void); // recalculate the mean and the deviation
};

LineOfCells

The LineOfCells object contains a linear array of DataCell objects. The LineOfCells could be a row of cells (e.g. the data from one group across repeated days) or a column of cells (e.g. the data on one day from all groups).

In addition to a list of cells that make up the LineOfCells, the object calculates derived values such as sum (total) of observations, number of observations, mean value of all observations, standard deviation of all observations, as well as the mean and standard deviation of the means of each cell.

Declaration

class LineOfCells:public Object {

// could be a row of cells or a column of cells
public:
char name[256]; // name of this line of cells
AnovaDataSet *data_set; // belongs to this data set
ListObject *cells; // these cells are in this line
double total; // total of all observations in this line
double mean; // mean of all observations in this line
double deviation; // deviation of all observations in this line
double obs_n; // number of observations in this line of cells
double mean_of_cell_means;
double deviation_of_cell_means;
LineOfCells(); // constructor with the name of the line
~LineOfCells(); // destructor to deallocate the list object
void Update(void); // update all the means & standard deviations

};