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

9 次查看(过去 30 天)
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

回答(1 个)

Tom Lane
Tom Lane 2013-4-9
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.

类别

Help CenterFile Exchange 中查找有关 Analysis of Variance and Covariance 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by