Does "Fit linear mixed-effects model" support nesting? what is the difference between Z and G in "fitlmematrix(X,y,Z,G)”

6 visualizaciones (últimos 30 días)
I have two questions regarding “Fit linear mixed-effects model”. 1. Does it support nested variables? 2. I am confused about Z (Random-effects design) and G (Grouping variable or variables) in “fitlmematrix(X,y,Z,G)” from (<http://www.mathworks.com/help/stats/fitlmematrix.html>) . In the definition of G it says “If there is one random-effects term, then G must be an n-by-1 vector corresponding to a single grouping variable with M levels or groups. If there are multiple random-effects terms, then G must be a cell array of length R. Each cell of G contains a grouping variable G{r}, r = 1, 2, ..., R, with M(r) levels.” It seems depending on the random variables defined in Z, G is defined. The only difference that I see between Z and G is that in Z each level is associated with one column, but G includes different levels in one column. I don’t understand the difference and why we specify random variables twice through Z and G.
I appreciate any help.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by