F-Test for difference between coefficients

조회 수: 11 (최근 30일)
Christian
Christian 2015년 5월 21일
편집: Alexis 2019년 11월 5일
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

채택된 답변

Alfonso Nieto-Castanon
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
Christian
Christian 2015년 5월 31일
Thanks so much Alfonso! You were a big help indeed!
Alexis
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 CenterFile Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by