-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interactions in random effect specification #100
Comments
Unfortunately, issues like this are in a backlog waiting for changes like JuliaStats/StatsModels.jl#30 in https://github.com/JuliaStats/StatsModels.jl which, in turn are waiting on the release of v0.11.0 of https://github.com/JuliaStats/DataFrames.jl Right now everything is in a holding pattern waiting for this version of |
Where did you ask? The roadmap is https://github.com/JuliaData/DataFrames.jl/issues?q=is%3Aopen+is%3Aissue+milestone%3A0.11, and there's at least one blocking issue there which is going to be resolved soon. |
Is there any news on this? DataFrames v0.11.0 has been released and JuliaStats/StatsModels.jl#30 seems to have merged. Being able to fit random slopes for interactions is a very important feature.. |
Fitting random slopes is possible on the current release of |
Looks good for tagging a release of I have a release of |
Julia 1.0.3 There is still a problem with interactions in the random effects. fm6 = fit(LinearMixedModel, @formula(Y ~ 1 + A * I + (1|G) + (1|H)), dat[:InstEval]) Changing the formula leads to errors: fm6 = fit(LinearMixedModel, @formula(Y ~ 1 + A * I + (1 + A|G) + (1|H)), df)
>>> MethodError: no method matching rmul!(::SparseArrays.SparseMatrixCSC{Float64,Int32}, ::RepeatedBlockDiagonal{Float64,LinearAlgebra.LowerTriangular{Float64,Array{Float64,2}}})
fm6 = fit(LinearMixedModel, @formula(Y ~ 1 + A * I + (1 + A|G)), df)
>>> OK
fm6 = fit(LinearMixedModel, @formula(Y ~ 1 + A * I + (1 + A & I|G)), df)
>>> MethodError: no method matching getindex(::DataFrame, ::Expr)
fm6 = fit(LinearMixedModel, @formula(Y ~ 1 + A * I + (1|G & H)), df)
>>> MethodError: no method matching getindex(::DataFrame, ::Expr) |
One feature that works in lme4 that seems not to work in MixedModels is interactions in the random effects. In MixedModels, a formula like
a ~ b * c + (b*c | subject)
fails with MethodError: no method matching getindex(::DataFrames.DataFrame, ::Expr)
and if I expand the * manually as b + c + b&c then it is the last term that triggers the error.
The problem occurs in the call to ModelFrame, but I have to admit I don't don't really understand what's going on in those functions.
Anyway the obvious workaround of constructing b .* c works, but I would appreciate any help getting the less cumbersome syntax for this working.
The text was updated successfully, but these errors were encountered: