F-Test for difference between coefficients
5 次查看(过去 30 天)
显示 更早的评论
Hi there,
I need to conduct F-Tests for differences in estimated regression coefficients. That is, to say: "Yes, the one coefficient is really lower/higher than the other" or "No, they are not statistically significantly different".
I believe, the equivalent stata command would be -test-. However, I can't seem to find how to do it matlab.
Any help is greatly appreciated!
Christian
0 个评论
采纳的回答
Alfonso Nieto-Castanon
2015-5-22
编辑:Alfonso Nieto-Castanon
2015-5-22
and use a contrast H that compares the two desired coefficients (e.g. [0 1 -1] compares the second and third regression coefficients in your linear model).
Generally, for a linear model of the form:
Y = X*B + noise
coeffTest will test any hypothesis of the form:
H*B = 0
(where H can be a vector or a matrix)
4 个评论
Alexis
2019-11-5
编辑:Alexis
2019-11-5
This answer is very straightforward and helpful, but can anyone clarify these instructions from the ML documentation:
"If you specify the 'DummyVarCoding' name-value pair argument as 'effects' when fitting the model using fitglme, then βA + βB + βC = 0, where βA, βB, and βC correspond to suppliers A, B, and C, respectively.
βA is the effect of A minus the average effect of A, B, and C.
[...] column 5 of the contrast matrix corresponds to βC, and column 6 corresponds to βB. Therefore, the contrast matrix for this test is specified as H = [0,0,0,0,1,2]."
I specify 'DummyVarCoding','effects' when I use fitglme(). Does this mean Alfonso Nieto-Castanon's suggestion below wouldn't work for my model?
"you may wish to test whether the values in the fourth group are different from the values in any of the other three groups, so you can use a contrast [-1 0 0 1; 0 -1 0 1; 0 0 -1 1]"
In my model, I have three types of trial. In the model read out, I get
Name Estimate SE tStat DF pValue Lower
'(Intercept)' 0.03416 0.0034769 9.825 2668 2.0978e-22 0.027343
'type_1' -0.0056054 0.0010517 -5.3297 2668 1.066e-07 -0.0076677
'type_2' 0.0037668 0.0012124 3.1068 2668 0.0019112 0.0013894
... ( + the other model terms)
Given ML's documentation and my use of 'DummyVarCoding', how can I test 'type_3' against the average of 'type_1' and 'type_2'?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!