estimate and SE in a linear regression becomes 0

...and tStat and pValue becomes NaN. What is the typical reason for that? It is a dummy (either 0 or 1) by the way.
I get the error message below after fitting the linear model (first line):
mdl = LinearModel.fit(ds,'linear','RobustOpts','on');
Warning: Regression design matrix is rank
deficient to within machine precision.
> In TermsRegression>TermsRegression.checkDesignRank at 98
In LinearModel.LinearModel>LinearModel.fit at 969
What is the typical reason for that?
It is a dummy (either 0 or 1) by the way.

 採用された回答

Shashank Prasanna
Shashank Prasanna 2013 年 8 月 8 日

0 投票

It means exactly what the error message is saying. Your data is rank deficient.
As a caution, when you use datasets as the input to your LinearModel.fit function it assumes that the very last column is the response variable 'y'. If this assumption is untrue in your case you will have to change it by specifying it explicitly using 'ResponseVar'.
Here is an example that yields the same error message you are getting and you can see from the data how it is bad:
mdl = LinearModel.fit(repmat(randn(1,4),10,1),ones(10,1),'linear','RobustOpts','on');

3 件のコメント

T27667
T27667 2013 年 8 月 9 日
編集済み: T27667 2013 年 8 月 9 日
Ok, thanks!
My response variable is in the last column of ds. Would it be methodically correct just to eliminate the explanatory variable that gets estimate and SE = 0? In other words, to treat it as the least significant explanatory variable and thereby eliminating it?
T27667
T27667 2013 年 8 月 14 日
編集済み: T27667 2013 年 8 月 14 日
Or would it be more correct to eliminate the explanatory variable with the highest p value and thereby leaving the variable with estimate and SE = 0 in the model? I assume the varible that gets estimate and SE = 0 is just randomly chosen by MATLAB.
T27667
T27667 2013 年 8 月 14 日
Ohh had one dummy to many. Sorry!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by