But we cannot call the as_dataframe method on the group level design matrix. Ie. we can only call
np.array(dm.group)
which result in this
but it would be nice to be able to call
dm.group.as_dataframe()
Not knowing how the internals work, I believe it would just be a matter of building a dataframe with the correct column labels, which should be 1|C(group)[0], 1|C(group)[1], and 1|C(group)[2].
This would be particularly useful for teaching and learning purposes.
Simulated data:
If we model this with
y ~ 1 + (1 | C(group))
and were interested in the design matrices, then at the moment we can do this:But we cannot call the
as_dataframe
method on the group level design matrix. Ie. we can only callwhich result in this
but it would be nice to be able to call
Not knowing how the internals work, I believe it would just be a matter of building a dataframe with the correct column labels, which should be
1|C(group)[0]
,1|C(group)[1]
, and1|C(group)[2]
.This would be particularly useful for teaching and learning purposes.