필터 지우기
필터 지우기

glfmfit logistic regression overparametrization issue

조회 수: 2 (최근 30일)
Al
Al 2016년 12월 8일
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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by