package com.imsl.test.example.stat; import com.imsl.stat.*; import com.imsl.math.PrintMatrix; /** *

* Generates binary regressors for classification variables. *

* * This example uses {@link RegressorsForGLM} to generate * binary variables for two classification variables, \(A\) and * \(B\), with two and three values, respectively. Regressors for a one-way * model (the default model order) are generated using the default dummy method. * The five regressors generated are \(A_1, A_2, B_1, B_2\) and * \(B_3\). * * @see Code * @see Output */ public class RegressorsForGLMEx1 { public static void main(String args[]) { double x[][] = { {10.0, 5.0}, {20.0, 15.0}, {20.0, 10.0}, {10.0, 10.0}, {10.0, 15.0}, {20.0, 5.0} }; RegressorsForGLM r = new RegressorsForGLM(x, 2); double regressors[][] = r.getRegressors(); int n = r.getNumberOfRegressors(); System.out.println("Number of regressors = " + n); new PrintMatrix("Regressors").print(regressors); } }