public IndependenceTest indTestSubset(List vars){
  if (vars.isEmpty()) {
    throw new IllegalArgumentException("Subset may not be empty.");
  }
  int[] indices=new int[vars.size()];
  int j=-1;
  for (int i=0; i < variables.size(); i++) {
    if (!vars.contains(variables.get(i))) {
      continue;
    }
    indices[++j]=i;
  }
  DataSet newDataSet=dataSet.subsetColumns(indices);
  return new IndTestGSquare(newDataSet,alpha);
}

public IndependenceTest indTestSubset ( List vars ) { if ( vars . isEmpty ( ) ) { throw new IllegalArgumentException ( "Subset may not be empty." ) ; } int [ ] indices = new int [ vars . size ( ) ] ; int j = - 1 ; for ( int i = 0 ; i < variables . size ( ) ; i ++ ) { if ( ! vars . contains ( variables . get ( i ) ) ) { continue ; } indices [ ++ j ] = i ; } DataSet newDataSet = dataSet . subsetColumns ( indices ) ; return new IndTestGSquare ( newDataSet , alpha ) ; }
creates a new indtestgsquare for a subset of the variables .
