why does fitlme with a random effect gives the same results to fitlme without the random effect
25 views (last 30 days)
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))
Ive J on 8 Aug 2021
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.