MATLAB: Where is the coefficient for the reference condition when using ‘fitlm’ to perform ANOVA with intercept omitted

anovafitlminterceptMATLABmissing group

I want to compare the means for a variable among five different groups. To do so, I use fitlm to perform an ANOVA. The following code provides an example that closely resembles my own data:
% simulate data
x = repmat([1:5]',[10,1]);
y = (x-4).^2 + randn([size(x),1]);
grp = categorical(x);
% fit model
fitlm(grp,y)
This yields an intercept, which represents the mean for grp 1, and coefficients for the other groups that represent the difference of the mean for those groups relative to the intercept.
I am unsure (and would also like to know) how to then calculate the standard error (SE) of the group means from the combination of the SE for the intercept and SE for the coefficients. I therefore tried omitting the intercept, expecting coefficients for each group
fitlm(grp,y,'Intercept',false)
Here there is indeed no intercept, but also no coefficient for group 1. Where did it go?
Aside, as a workaround, I tried dummy coding the group variable
grp_dummy = dummyvar(grp);
fitlm(grp_dummy,y,'Intercept',false)
This gives me the expected result, but the SE correspond to the SE of the intercept in the first model. How then do the SE of the coefficients of the first model fit in with this latter model?

Best Answer

Why not just use this?
for iGrp=1:5
stderr = std(y(x==iGrp)) / sqrt( sum(x==iGrp) )
end