Wald test Jacobian matrix

1 回表示 (過去 30 日間)
M Fernandes
M Fernandes 2017 年 11 月 15 日
Dear Matlab, I have the following regression: mpg=b0+b1*weight+b2*foreign and I want to estimate the hypothesis that b1*b2=1. I am using the following code:
mpg=data(:,2);
weight=data(:,6);
foreign=data(:,11);
n=74;
b0=ones(n,1);
X=[b0 weight foreign];
beta_regress=regress(mpg,X)
r=[beta_regress(2,1)*beta_regress(3,1)-1];
R=[0 beta_regress(3,1) beta_regress(2,1)];
alpha=0.05;
[h,pvalue]=waldtest(r,R,alpha)
But when I run I obtain this message:
Error using waldtest (line 271)
Jacobian matrices must be q-by-p, where q is the number of
restrictions and p is the number of unrestricted parameters.
So, my question is: how should I code the Jacobian matrix?
I also have a 2nd question: how my code should change (given that I want to estimate the Wald test) in case I want to use robust standard errors?
Thanks

回答 (0 件)

カテゴリ

Help Center および File ExchangeHypothesis Tests についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by