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 CenterFile Exchange에서 Hypothesis Tests에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by