import java.io.*; import com.imsl.stat.*; import com.imsl.math.*; public class CategoricalGenLinModelEx2 { public static void main(String argv[]) throws Exception { // Set up a PrintMatrix object for later use. PrintMatrixFormat mf; PrintMatrix p; p = new PrintMatrix(); mf = new PrintMatrixFormat(); mf.setNoRowLabels(); mf.setNoColumnLabels(); double[][] x = { {0.0, 5.0, 0.0, 1.0, 0.0}, {9.0, 4.0, 3.0, 0.0, 0.0}, {0.0, 4.0, 1.0, 0.0, 0.0}, {9.0, 0.0, 2.0, 1.0, 1.0}, {0.0, 1.0, 0.0, 0.0, 1.0}, }; CategoricalGenLinModel CATGLM; CATGLM = new CategoricalGenLinModel(x, CategoricalGenLinModel.MODEL0); CATGLM.setUpperEndpointColumn(0); CATGLM.setLowerEndpointColumn(1); CATGLM.setOptionalDistributionParameterColumn(1); CATGLM.setCensorColumn(2); CATGLM.setInfiniteEstimateMethod(0); CATGLM.setModelIntercept(1); int[] indcl = {3, 4}; CATGLM.setClassificationVariableColumn(indcl); int[] nvef = {1, 1}; int[] indef = {3, 4}; CATGLM.setEffects(indef, nvef); CATGLM.setUpperBound(4); p.setTitle("Coefficient Statistics"); p.print(CATGLM.solve()); System.out.println("Log likelihood " + CATGLM.getOptimizedCriterion()); p.setTitle("Asymptotic Coefficient Covariance"); p.setMatrixType(1); p.print(CATGLM.getCovarianceMatrix()); p.setMatrixType(0); p.setTitle("Case Analysis"); p.print(CATGLM.getCaseAnalysis()); p.setTitle("Last Coefficient Update"); p.print(CATGLM.getLastParameterUpdates()); p.setTitle("Covariate Means"); p.print(CATGLM.getDesignVariableMeans()); p.setTitle("Distinct Values For Each Class Variable"); p.print(CATGLM.getClassificationVariableValues()); System.out.println("Number of Missing Values " + CATGLM.getNRowsMissing()); } }