Warning: X is rank deficient to within machine precision. > In regress at 84
6 次查看(过去 30 天)
显示 更早的评论
Hello, i'm facing a problem with my multivariate linear regression (function : regress). I'm analyzing an incomplete panel data (with nans), in order to see what variables of my panel affect the variable "Returns on Assets". My teacher told me to include indicator variables (0,1) for each year, in order to get rid of variations explained by time. I have 19 indicator variables (from 1996 to 2014) and 5 or 6 independant variables (i checked for multicolinearity between those variables, it seems that there is no problem). The problem is that when i m running the regression, matlab sets 1 or 2 indicator variables betas to 0 and says this to me :
Warning: X is rank deficient to within machine precision.
> In regress at 84
Here is my function :
[b4, bint4,~,~,stats4]=regress(ROA, [ones(length(WinROA),1) Ind1996 Ind1997 Ind1998 Ind1999 Ind2000 Ind2001 Ind2002 Ind2003 Ind2004 Ind2005 Ind2006 Ind2007 Ind2008 Ind2009 Ind2010 Ind2011 Ind2012 Ind2013 Ind2014 OPEXP_LP BPSM WO CPB AVLB_GNI], 0.1)
And the result :
Warning: X is rank deficient to within machine precision.
> In regress at 84
b4 =
0.098453
-0.12541
0
-0.021372
-0.026422
-0.01052
[...]
I think the problem is coming from my indicator variables, but my teacher says that i shouldn't have any problem with so few variables (he did it on Stata, and he seemed to have no problem). Is there antoher way to do this? If somone can help, i would hugely appreciate. Thanks
0 个评论
回答(2 个)
Star Strider
2015-4-29
I haven’t much recent experience with this myself, but I believe you need the dummyvar function, and specifically the documentation on Dummy Indicator Variables.
0 个评论
xin lyu
2018-5-7
if someone solve this problm,answer me please ,too. I met this problwm as while...help
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!