Hello: the following gives an error
data = DataFrame(Y = [0,3,1,7,1,0,7,5,1], X1 = [1,2,3,1,2,3,1,2,3], X2 = [1,1,1,2,2,2,3,3,3])
model = glm(@formula(Y ~ X1 + X2), data, Binomial(10))
Error msg:
ERROR: LoadError: DomainError:
log will only return a complex result if called with a complex argument. Try log(complex(x)).
Stacktrace:
[1] nan_dom_err at ./math.jl:300 [inlined]
[2] log at ./math.jl:419 [inlined]
[3] logit(::Float64) at /home/hungngo/.julia/v0.6/StatsFuns/src/basicfuns.jl:45
[4] macro expansion at /home/hungngo/repos/git/GLM.jl/src/glmfit.jl:241 [inlined]
[5] macro expansion at ./simdloop.jl:73 [inlined]
[6] initialeta!(::Distributions.Binomial{Float64}, ::GLM.LogitLink, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}) at /home/hungngo/repos/git/GLM.jl/src/glmfit.jl:239
[7] #fit#16(::Bool, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Any,1}, ::Function, ::Type{GLM.GeneralizedLinearModel}, ::Array{Float64,2}, ::Array{Float64,1}, ::Distributions.Binomial{Float64}, ::GLM.LogitLink) at /home/hungngo/repos/git/GLM.jl/src/glmfit.jl:295
[8] #fit#17(::Array{Any,1}, ::Function, ::Type{GLM.GeneralizedLinearModel}, ::Array{Float64,2}, ::Array{Int64,1}, ::Distributions.Binomial{Float64}, ::GLM.LogitLink) at /home/hungngo/repos/git/GLM.jl/src/glmfit.jl:311
[9] fit(::Type{GLM.GeneralizedLinearModel}, ::Array{Float64,2}, ::Array{Int64,1}, ::Distributions.Binomial{Float64}) at /home/hungngo/repos/git/GLM.jl/src/glmfit.jl:311
[10] #fit#44(::Dict{Any,Any}, ::Array{Any,1}, ::Function, ::Type{GLM.GeneralizedLinearModel}, ::StatsModels.Formula, ::DataFrames.DataFrame, ::Distributions.Binomial{Float64}, ::Vararg{Distributions.Binomial{Float64},N} where N) at /home/hungngo/.julia/v0.6/StatsModels/src/statsmodel.jl:72
[11] fit(::Type{GLM.GeneralizedLinearModel}, ::StatsModels.Formula, ::DataFrames.DataFrame, ::Distributions.Binomial{Float64}) at /home/hungngo/.julia/v0.6/StatsModels/src/statsmodel.jl:66
[12] #glm#18(::Array{Any,1}, ::Function, ::StatsModels.Formula, ::DataFrames.DataFrame, ::Distributions.Binomial{Float64}, ::Vararg{Distributions.Binomial{Float64},N} where N) at /home/hungngo/repos/git/GLM.jl/src/glmfit.jl:314
[13] glm(::StatsModels.Formula, ::DataFrames.DataFrame, ::Distributions.Binomial{Float64}, ::Vararg{Distributions.Binomial{Float64},N} where N) at /home/hungngo/repos/git/GLM.jl/src/glmfit.jl:314
[14] include_string(::String, ::String) at ./loading.jl:522
[15] include_string(::Module, ::String, ::String) at /home/hungngo/.julia/v0.6/Compat/src/Compat.jl:71
[16] (::Atom.##112#116{String,String})() at /home/hungngo/.julia/v0.6/Atom/src/eval.jl:109
[17] withpath(::Atom.##112#116{String,String}, ::String) at /home/hungngo/.julia/v0.6/CodeTools/src/utils.jl:30
[18] withpath(::Function, ::String) at /home/hungngo/.julia/v0.6/Atom/src/eval.jl:38
[19] hideprompt(::Atom.##111#115{String,String}) at /home/hungngo/.julia/v0.6/Atom/src/repl.jl:67
[20] macro expansion at /home/hungngo/.julia/v0.6/Atom/src/eval.jl:106 [inlined]
[21] (::Atom.##110#114{Dict{String,Any}})() at ./task.jl:80
Was that expected, or did I do something stupid? Thanks!