Understanding plotEffects and plotInteractions outputs on models created using fitlm

3 views (last 30 days)
After I create a linear model using fitlm and start testing the effects (plotEffects) and their interactions (plotInteractions) on my model the functions don’t appear to be using all the data inside a single variable. For example, I am trying to see if there is an effect of individual (N=14) or as I label it ID, on a data set and when my effect results come back it doesn’t list all my individuals (ID), it just says ID: 9 to 1. Other data sets ID:13 to 5. The same thing occurs when I try to see if there is a presentation effect on my results. Instead of all 9 presentations, I call them Tests, being used it only uses 1, 5, and 9.
My immediate observation tells me that Tests are using the first, middle, and last test. As I look through the 13 different models, I’ve created for 13 different data sets this appears to be constant. However, this is not true of ID. The different models seem to be choosing different crabs and I don’t seem to be able to find a pattern. Could this possibly do to the fact that ID is input as a category and hence random IDs are picked. It doesn’t seem to be picking the outliers or extreme data points.
This is the input to my linear model.
mdl = fitlm(X(:,2:4),Response,'interactions','ResponseVar','Response','PredictorVars',{'ID','Contrast','Tests'},'CategoricalVar',{'ID'});
Responses are coded as either a response 1 or no response 0. The matrix is (117,1);
X is (117,4). Column 2 is ID (13 individuals with 9 tests each);
Column 3 are the 9 different testing conditions (e.g. light levels);
Column 4 is test number (e.g. 1:9 repeated for each individual).
Column 1 is just a column of ones, which are not necessary when using fitlm and are excluded.
I hope this is enough information to help you with my problem.
Thanks in advance!

Answers (0)

Community Treasure Hunt

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

Start Hunting!