A.17. Construction of a Design Matrix

Often, we may need to create a design matrix (usually denoted by X in linear models contexts) corresponding to a given experimental design. The function DESIGN will provide such a matrix. This is best illustrated by an example.

Suppose we want the design matrix corresponding to a one-way classification model with three groups. The sample sizes are n1 =3,n2 =2 and n3 = 5. As a result, n=n1+n2+n3= 10. What one needs to do is to define a column vector titled ADDRESS which provides the addresses for all nonzero entries (all of which would be 1) in the individual rows. For instance, if the seventh entry in the column ADDRESS is 3 then in the seventh row of resulting matrix X a '1' will be placed in the third ...

Get APPLIED MULTIVARIATE STATISTICS: WITH SAS® SOFTWARE now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.