Nosferican / Econometrics.jl

Econometrics in Julia
https://nosferican.github.io/Econometrics.jl/dev
ISC License
69 stars 19 forks source link

Issue with the ordinal response model based on number of features #10

Closed Nosferican closed 5 years ago

Nosferican commented 5 years ago

Describe the bug There is a bug in the code that breaks when the number of features differs from three (plus intercept).

To Reproduce

using Econometrics, RDatasets
data = dataset("Ecdat", "Kakadu") |>
        (data -> select(data, [:RecParks, :Sex, :Age, :Schooling]))
    data.RecParks = convert(Vector{Int}, data.RecParks)
    data.RecParks = levels!(categorical(data.RecParks, ordered = true), collect(1:5))
model = fit(EconometricModel,
            @formula(RecParks ~ Age + Sex),
            data)