Instead of defining K groups with K columns of dummy variables, use a single column that has integer value of the group of that subject, one of 1,...,K.
Then, instead of having to separately specify the number of groups and covariates, it can automatically inferred:
Number of groups, inferred from maximum integer; need to check that all K groups have observations.
Number of covariates inferred as number of table columns minus 3 (1 for ID#, 1 for group, 1 for filename)
This, of course, will require new code to:
Infer the number of columns
Convert integer group values into a NxK array of dummy variables
But, having done this, there will be no need to specify the number of groups and covariates on the command line.
To simplify usage, change the input table to:
Then, instead of having to separately specify the number of groups and covariates, it can automatically inferred:
This, of course, will require new code to:
But, having done this, there will be no need to specify the number of groups and covariates on the command line.