coeftest to test simple effects

조회 수: 11 (최근 30일)
Alex
Alex 2015년 12월 18일
댓글: Alexis 2020년 6월 7일
I have run fitglme with 2 categorical variables (X1, X2) and an interaction term as predictors. Each categorical variable has 2 levels - let's call the levels A and B. I would like to use coefTest to test, say, whether X1 level A vs. X1 level B are significantly different but only at X2 level B. I would also like to test whether X1 level A and X2 level A are significantly different from one another.
I understand that the columns of coefTest are the predictors but I don't really understand what's on the rows? If I make 4 rows what are the 3rd and 4th rows?
Thanks for any insight you can offer.
  댓글 수: 4
jgg
jgg 2016년 7월 22일
I think your confusion is because it's performing the joint hypothesis test that Hb = 0; so it will only return a single p value for the F test of this hypothesis.
The key is to figure out how you can write your hypothesis as a linear combination of the coefficients in your model.
John Hartman
John Hartman 2019년 6월 27일
As mentioned by jgg, you must test linear combinations of the model coefficients. Sometimes though, your model may change or you may have a lot of coefficients which can make manually defining long contrast vectors tedious. People frequently use more interpretable linear combinations of the coefficients, i.e. estimated marginal (or predicted, or least squares) means. Then, these functions may be of use https://www.mathworks.com/matlabcentral/fileexchange/71970-emmeans

댓글을 달려면 로그인하십시오.

답변 (1개)

Rohan Joshi
Rohan Joshi 2016년 7월 21일
I am looking for an answer to the exact same question!
  댓글 수: 1
Alexis
Alexis 2020년 6월 7일
Same, as are many here. I keep finding my own posts from more than a year ago asking the same questions. TMW, please either deal with the backlog of questions or improve the documentation!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Design of Experiments (DOE)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by