Wald test Jacobian matrix
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Industrial Statistics finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!