I am trying to run a mixed-effects model in julia (R is too slow for my data), but I keep getting this error.
I have installed DataArrays, DataFrames , MixedModels, and RDatasets packages and am following the tutorial here --> http://dmbates.github.io/MixedModels.jl/latest/man/fitting/#Fitting-linear-mixed-effects-models-1
These are my steps:
using DataArrays, DataFrames , MixedModels, RDatasets
I get these warnings
WARNING: Method definition ==(Base.Nullable{S}, Base.Nullable{T}) in module Base at nullable.jl:238 overwritten in module NullableArrays at /home/home/.julia/v0.6/NullableArrays/src/operators.jl:128. WARNING: Method definition model_response(DataFrames.ModelFrame) in module DataFrames at /home/home/.julia/v0.6/DataFrames/src/statsmodels/formula.jl:352 overwritten in module MixedModels at /home/home/.julia/v0.6/MixedModels/src/pls.jl:65. WARNING: Method definition ==(Base.Nullable{S}, Base.Nullable{T}) in module Base at nullable.jl:238 overwritten in module NullableArrays at /home/home/.julia/v0.6/NullableArrays/src/operators.jl:128. WARNING: Method definition ==(Base.Nullable{S}, Base.Nullable{T}) in module Base at nullable.jl:238 overwritten in module NullableArrays at /home/home/.julia/v0.6/NullableArrays/src/operators.jl:128. WARNING: Method definition model_response(DataFrames.ModelFrame) in module DataFrames at /home/home/.julia/v0.6/DataFrames/src/statsmodels/formula.jl:352 overwritten in module MixedModels at /home/home/.julia/v0.6/MixedModels/src/pls.jl:65. WARNING: Method definition model_response(DataFrames.ModelFrame) in module DataFrames at /home/home/.julia/v0.6/DataFrames/src/statsmodels/formula.jl:352 overwritten in module MixedModels at /home/home/.julia/v0.6/MixedModels/src/pls.jl:65.
I get an R dataset from lme4 package (used in the tutorial)
inst = dataset("lme4", "InstEval")
julia> head(inst)
6×7 DataFrames.DataFrame
│ Row │ S │ D │ Studage │ Lectage │ Service │ Dept │ Y │
├─────┼─────┼────────┼─────────┼─────────┼─────────┼──────┼───┤
│ 1 │ "1" │ "1002" │ "2" │ "2" │ "0" │ "2" │ 5 │
│ 2 │ "1" │ "1050" │ "2" │ "1" │ "1" │ "6" │ 2 │
│ 3 │ "1" │ "1582" │ "2" │ "2" │ "0" │ "2" │ 5 │
│ 4 │ "1" │ "2050" │ "2" │ "2" │ "1" │ "3" │ 3 │
│ 5 │ "2" │ "115" │ "2" │ "1" │ "0" │ "5" │ 2 │
│ 6 │ "2" │ "756" │ "2" │ "1" │ "0" │ "5" │ 4 │
I run the model as shown in the tutorial
m2 = fit!(lmm(y ~ 1 + dept*service + (1|s) + (1|d), inst))
and get
ERROR: UndefVarError: y not defined
Stacktrace:
[1] macro expansion at ./REPL.jl:97 [inlined]
[2] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73
The same thing happens when I try it with my own data loaded using "readtable" from DataFrames package
I am running julia 0.6.0 and all packages are freshly installed. My system is arch linux 4.11.7-1 with all the latest packages. Julia installs without a problem, but some packages give warnings (see above).
m2 = fit!(lmm(Y ~ 1 + Dept*Service + (1|S) + (1|D), inst))
– rickhg12hs