Which model to use with a d optimal design and a categorical factor?

3 visualizzazioni (ultimi 30 giorni)
Hey everyone,
I am trying to design an d-optimal experiment with 3 continuous factors and 1 categorical factor. The MATLAB calculation goes smoothly, but I don't understand the output of the design matrix X... Here comes the example:
% setting the boundaries
nfactors = 3
nfactors = 3
nruns = 10
nruns = 10
% using rowexch to generate a D-optimal design
% first factor = categorical with 3 fixed levels
% 2nd - 4th factor = 4 levels (avoid 0, due to deconstructive inteference)
[dRE,X] = rowexch(nfactors,nruns,'interaction','categorical',1,'levels',3,'tries',50)
Warning: Starting design is rank deficient
dRE = 10×3
1 1 1 2 1 -1 1 -1 1 2 -1 1 2 -1 -1 1 -1 -1 3 1 -1 3 -1 -1 3 -1 1 1 1 -1
X = 10×10
1 1 0 1 1 1 0 1 0 1 1 0 1 1 -1 0 1 0 -1 -1 1 1 0 -1 1 -1 0 1 0 -1 1 0 1 -1 1 0 -1 0 1 -1 1 0 1 -1 -1 0 -1 0 -1 1 1 1 0 -1 -1 -1 0 -1 0 1 1 0 0 1 -1 0 0 0 0 -1 1 0 0 -1 -1 0 0 0 0 1 1 0 0 -1 1 0 0 0 0 -1 1 1 0 1 -1 1 0 -1 0 -1
Neglacting the fact that the design is rank effiecient in this example, how would I interpret my matrix X? Because it can't be 1) constant term 2) linear term 3) interaction term... The first three columns must be something else. Can someone please help?
Really appreciated,
Kim

Risposte (1)

Shubham
Shubham il 18 Gen 2024
Hi Kim,
The design matrix X that you've obtained from the rowexch function in MATLAB represents the coded levels for each factor in your experimental design, including the interactions and possibly other polynomial terms, depending on the options you've set for the experimental design. Here's a breakdown of how to interpret the columns of X:
  1. Column 1 (Constant Term): This column is filled with ones and represents the intercept term in the model. It is included so that the model can fit a mean value for the response variable when all other factors are at their reference levels (usually coded as zero).
  2. Column 2-4 (Categorical Factor Levels): Since you have a categorical factor with 3 levels, these columns represent the dummy coding for the categorical factor. Dummy coding is a way to include categorical variables in regression models by converting the categories into binary columns. Since you have 3 levels, you need 2 columns to represent them (since one level can be inferred when the other two are zero). However, it seems there is a discrepancy because you have three columns filled with zeros and ones, which might be an error or a misunderstanding. Normally, for 3 levels, you would have only 2 columns for dummy coding.
  3. Column 5-7 (Continuous Factors): These columns represent the coded levels for the continuous factors. The coding is usually done to center the factors around zero to simplify the interpretation of main effects and interactions. The coding might be -1, +1 for a two-level factor or could include other levels if more than two levels are used.
  4. Column 8-10 (Interactions and Higher-Order Terms): These columns typically represent the interaction terms and possibly quadratic or higher-order terms for the continuous factors. Interaction terms are the product of the coded levels of two factors and represent the combined effect of those factors on the response variable. Quadratic or higher-order terms represent the non-linear effects of the factors on the response variable.
To clarify, the expected structure for your design matrix might look something like this:
  • Column 1: Constant term (intercept)
  • Columns 2-3: Dummy-coded categorical factor (2 columns for 3 levels)
  • Columns 4-6: Continuous factors (3 columns for 3 factors)
  • Columns 7-9: Two-factor interactions (if you're including interactions between all pairs of factors, you'd expect 3 choose 2 = 3 interaction terms)
  • Additional columns: Any higher-order terms or additional interactions specified in the design
To resolve the discrepancy and correctly interpret your design matrix, ensure that the design is specified correctly in MATLAB and that you understand the coding scheme used for the categorical and continuous factors.

Prodotti


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by