Clear Filters
Clear Filters

glfmfit logistic regression overparametrization issue

2 views (last 30 days)
Hello all,
I have a data-set with two categorical predictors (A and B) and one binary output C; therefore, I decided to use logistic regression.
Predictor A has nine possible variables Predictor B has sixteen possible variables
Each possible variable for each predictor has been used at least six times. There are 2002 observations, which each have a corresponding predictor A, B, and out C value.
Given that there are categorical variables, I have grouped them together using dummy variables. When the dummy variable matrix was input into glmfit, I removed a column of variables from the dummy variable matrix in order to account for the intercept.
Despite this, I still get the following response:
Warning: X is ill conditioned, or the model is overparameterized, and some coefficients are not identifiable. You should use caution in making predictions.
My code is as follows:
data=csvread('Iraq_Afghanistan_DATA_numeric_only.csv');
target = data(:,4);
perpetrator = data(:,5);
weapon= data(:,6);
tp=[target perpetrator];
ntp=dummyvar(tp);
ntp2=ntp(:,1:24);
[b,dev,stats] = glmfit(ntp2, nweapon','binomial','logit');
Thank you

Answers (0)

Community Treasure Hunt

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

Start Hunting!