Testing equality of two coefficients of the same model within two sub-sample (Wald test)

6 views (last 30 days)
Hi,
I just want to test the equality of the intercepts of a regression in two sub-samples. I know I can test it using Wald test in Matlab. But, I couldn't figure it out how to use that. My regressions would be as follow:
y=a1+b1x1+b2x2+b3x3 (data from 2000-2005)
y=a2+bb1x1+bb2x2+bb3x3 (data from 2005-2010)
I want to test a1=a2 using wald test in matlab and get the p-value and its relevant statistics. I know the function is [h,pValue,stat,cValue] = waldtest(r,R,EstCov,alpha] but I dont know what to put as input in the function in this case.
Thank you so much in advance for your help.
Bests

Answers (1)

Tom Lane
Tom Lane on 9 Apr 2013
There is a linhyptest Statistics Toolbox function that may help. It requires a vector of coefficient values and a matrix of their estimated covariance. If you are fitting disjoint data sets, you may be able to concatenate the coefficient vectors for the two fits, and use blkdiag() to join the two covariance matrices.
For this to make sense I presume you can get a covariance matrix for the two estimated coefficient vectors, and your two fits can reasonably be described as independent.

Tags

Community Treasure Hunt

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

Start Hunting!