This works for me:

```

*julia> **fit(GeneralizedLinearModel,Y~X,data,Binomial(),ProbitLink())*

*DataFrameRegressionModel{GeneralizedLinearModel,Float64}:*

*Coefficients:*

*                Estimate Std.Error     z value Pr(>|z|)*

*(Intercept)     0.430727   1.98019    0.217518   0.8278*

*X            2.37745e-17   0.91665 2.59362e-17   1.0000*

*julia> **fit(GeneralizedLinearModel,Y~X,data,Binomial(),LogitLink())*

*DataFrameRegressionModel{GeneralizedLinearModel,Float64}:*

*Coefficients:*

*                 Estimate Std.Error      z value Pr(>|z|)*

*(Intercept)      0.693147   3.24037      0.21391   0.8306*

*X            -7.44332e-17       1.5 -4.96221e-17   1.0000*

*```*

On Sunday, August 31, 2014 1:27:15 PM UTC-4, Bradley Setzler wrote:
>
> 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