// In this tab a java beanshell script is automatically created for all the steps you make in the GUI. // Just save the text with right-click to a file and start PROMPT from the command line with the filename as a parameter. // Usage: PROMPT ScriptFilename import *; GuiCfg.readCfgStudio(); System.setProperty("scriptingMode", "true"); //This block we would only need in the interactive mode or to further process the data loadfile = "data.txt"; res = new EngineResults(); res.loadDataFromFile(loadfile); result0=res; title = "result0"; dataTable = new DataTable(result0, title); //dataTable.showTable(); //Here the test is performed //Note the absolute path to the data filename test0 = new prompt.statistic.ChiSq(); test0.init(result0, "testm", "result0 = read.table(\"contingency_table2.txt\", header = TRUE)"); test0.run(); result1 = test0.getResults(); title = "Test results: p-val="+test0.getPValue(); dataTable = new DataTable(result1, title); dataTable.showTable(); //the test result is an IEngineResult that contains the p-value and test statistics in a key-value manner System.out.println(result1); //or alternatively System.out.println(test0.getPValue());