/*
	Minimal application that performs a sequential analysis
	lobsterman 01/04/24
*/

import JavaGrinders.*;

public class TransitionAnalysisDemo {

	public static void main(String args[]) {
	try {
    	// define and contruct a Parser for a DataFile with a given name.
        // Note, for this to work you need to place this file in the same
        // harddisk directory as your project. If no name is provided then
        // a standard filechooser dialog box will pop up allowing you to
        // select a file from your hard disk.
        DataFileParser myParser = new DataFileParser("DataFiles/TransitionsTest.txt");
        // now construct a VariableOrganizer from the Parser
        VariableOrganizer myOrganizer = new VariableOrganizer(myParser,false);
        // contruct variables and register them with the VariableOrganizer 
        intVariable Activity = new intVariable("Activity",myOrganizer);
        // now fill them with data from the internal array of the Parser 
        Activity.fillWithParser(myParser,0);
        Activity.selectRange(0,9,false);
        ContingencyTable aTable = Activity.getTransitions();
		aTable.listTable();
        aTable.listFTukeyDeviates();
        ContingencyAnalyzer myContingencyAnalyzer = new ContingencyAnalyzer(myOrganizer, aTable);
        myContingencyAnalyzer.listTestIndependence();
	} catch (Throwable e) { System.err.println(e); }
	}
}
