why does fitlme with a random effect gives the same results to fitlme without the random effect
Show older comments
considering the data attached.
tbl = readtable('t.txt');
mdl1 = fitlme(tbl, 'y ~ g + (1|match)')
mdl2 = fitlme(tbl, 'y ~ g')
Why do they give exactly the same outputs? Presumebly the first model should be equivalent to a paird t-test
[h, p] = ttest(tbl.y(tbl.g == 1), tbl.y(tbl.g == 0))
Answers (1)
Ive J
on 8 Aug 2021
0 votes
This shows the model fits well with only fixed effect and there is no variance left for random effects. Also, your observations (sample size) to group ratio is relatively small. Either increase your sample size (which I guess not possible with your current design), or simply use fitlm instead.
Categories
Find more on Resampling Techniques in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
