Hi All,
I am new to Julia. I am trying to use the package FixedEffectModels.
After adding the Package I am trying to run the code as provided in the Readme file of the github package:
using DataFrames, RDatasets, FixedEffectModels
df = dataset(“plm”, “Cigar”)
reg(df, @formula(Sales ~ NDI + fe(State) + fe(Year)), Vcov.cluster(:State), weights = :Pop)
The problem is that it is failing to precompile the FixedEffectModels for some reason I cannot figure out why. The following is the error message that I receive:
[ Info: Precompiling FixedEffectModels [9d5cd8c9-2029-5cab-9928-427838db53e3]
ERROR: LoadError: MethodError: no method matching abs2(::SubArray{Float64, 1, Matrix{Float64}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true})
Closest candidates are:
abs2(::Complex) at complex.jl:278
abs2(::DualNumbers.Dual) at C:\Users\lenovo.julia\packages\DualNumbers\5knFX\src\dual.jl:204
abs2(::Bool) at bool.jl:150
…
Stacktrace:
[1] MappingRF (repeats 2 times)
@ .\reduce.jl:95 [inlined]
[2] _foldl_impl
@ .\reduce.jl:58 [inlined]
[3] foldl_impl(op::Base.MappingRF{Base.var"#242#243"{Vector{Float64}}, Base.MappingRF{typeof(abs2), Base.BottomRF{typeof(Base.add_sum)}}}, nt::Base._InitialValue, itr::Base.OneTo{Int64})
@ Base .\reduce.jl:48
[4] mapfoldl_impl(f::typeof(abs2), op::typeof(Base.add_sum), nt::Base._InitialValue, itr::Base.Generator{Base.OneTo{Int64}, Base.var"#242#243"{Vector{Float64}}})
@ Base .\reduce.jl:44
[5] mapfoldl(f::Function, op::Function, itr::Base.Generator{Base.OneTo{Int64}, Base.var"#242#243"{Vector{Float64}}}; init::Base._InitialValue)
@ Base .\reduce.jl:170
[6] mapfoldl
@ .\reduce.jl:170 [inlined]
[7] #mapreduce#263
@ .\reduce.jl:302 [inlined]
[8] mapreduce
@ .\reduce.jl:302 [inlined]
[9] sum#266
@ .\reduce.jl:528 [inlined]
[10] sum(f::Function, a::Base.Generator{Base.OneTo{Int64}, Base.var"#242#243"{Vector{Float64}}})
@ Base .\reduce.jl:528
[11] (::FixedEffectModels.var"#64#74")(x::Base.Generator{Base.OneTo{Int64}, Base.var"#242#243"{Vector{Float64}}})
@ FixedEffectModels .\none:0
[12] iterate
@ .\generator.jl:47 [inlined]
[13] collect(itr::Base.Generator{Vector{Base.Generator{Base.OneTo{Int64}}}, FixedEffectModels.var"#64#74"})
@ Base .\array.jl:787
[14] fit(::Type{FixedEffectModels.FixedEffectModel}, formula::StatsModels.FormulaTerm, df::Any, vcov::StatsBase.CovarianceEstimator; contrasts::Dict, weights::Union{Nothing, Symbol}, save::Union{Bool, Symbol}, method::Symbol, nthreads::Integer, double_precision::Bool, tol::Real, maxiter::Integer, drop_singletons::Bool, progress_bar::Bool, subset::Union{Nothing, AbstractVector}, first_stage::Bool)
@ FixedEffectModels C:\Users\lenovo.julia\packages\FixedEffectModels\9B0we\src\fit.jl:239
[15] #reg#56
@ C:\Users\lenovo.julia\packages\FixedEffectModels\9B0we\src\fit.jl:64 [inlined]
[16] reg (repeats 2 times)
@ C:\Users\lenovo.julia\packages\FixedEffectModels\9B0we\src\fit.jl:49 [inlined]
[17] macro expansion
@ C:\Users\lenovo.julia\packages\FixedEffectModels\9B0we\src\FixedEffectModels.jl:44 [inlined]
[18] top-level scope
@ C:\Users\lenovo.julia\packages\PrecompileTools\L8A3n\src\workloads.jl:78
[19] include
@ .\Base.jl:419 [inlined]
[20] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
@ Base .\loading.jl:1554
[21] top-level scope
@ stdin:1
in expression starting at C:\Users\lenovo.julia\packages\FixedEffectModels\9B0we\src\FixedEffectModels.jl:2
in expression starting at stdin:1
ERROR: Failed to precompile FixedEffectModels [9d5cd8c9-2029-5cab-9928-427838db53e3] to C:\Users\lenovo.julia\compiled\v1.8\FixedEffectModels\jl_887C.tmp.
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base .\loading.jl:1707
[3] compilecache
@ .\loading.jl:1651 [inlined]
[4] _require(pkg::Base.PkgId)
@ Base .\loading.jl:1337
[5] _require_prelocked(uuidkey::Base.PkgId)
@ Base .\loading.jl:1200
[6] macro expansion
@ .\loading.jl:1180 [inlined]
[7] macro expansion
@ .\lock.jl:223 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1144
Thank you for your help