Has anyone successfully performed probit or logit regression in Julia? The GLM 
documentation <https://github.com/JuliaStats/GLM.jl> does not provide a 
generalizable example of how to use glm(). It gives a Poisson example 
without any suggestion of how to switch from Poisson to some other type.

*Using the Poisson example from GLM documentation works:*

julia> X = [1;2;3.]
julia> Y = [1;0;1.]
julia> data = DataFrame(X=X,Y=Y)
julia> fit(GeneralizedLinearModel, Y ~ X,data, Poisson())
DataFrameRegressionModel{GeneralizedLinearModel,Float64}: 
Coefficients: 
Estimate Std.Error z value Pr(>|z|) 
(Intercept) -0.405465 1.87034 -0.216787 0.8284 
X -3.91448e-17 0.8658 -4.52123e-17 1.0000 

*But does not generalize:*

julia> fit(GeneralizedLinearModel, Y ~ X ,data, Logit()) 
ERROR: Logit not defined

julia> fit(GeneralizedLinearModel, Y ~ X, data, link=:ProbitLink) 
ERROR: `fit` has no method matching fit(::Type{GeneralizedLinearModel}, 
::Array{Float64,2}, ::Array{Float64,1})

julia> fit(GeneralizedLinearModel, Y ~ X, data, 
family="binomial",link="probit") 
ERROR: `fit` has no method matching fit(::Type{GeneralizedLinearModel}, 
::Array{Float64,2}, ::Array{Float64,1})

....and a dozen other similar attempts fail. 


Thanks,
Bradley

Reply via email to