Predict values using multinomial logistic regression?

Might be good to add docs for predict to the packages, but from the test of OrdinalMultinomialModels.jl you can get:

julia> using OrdinalMultinomialModels, RDatasets

julia> housing = dataset("MASS", "housing");

julia> houseplr1 = polr(@formula(Sat ~ Infl + Type + Cont), housing,
                   LogitLink(), wts = housing[!, :Freq])
StatsModels.TableRegressionModel{OrdinalMultinomialModel{Int64, Float64, LogitLink}, Matrix{Float64}}

Sat ~ Infl + Type + Cont

Coefficients:
───────────────────────────────────────────────────────────────
                        Estimate  Std.Error   t value  Pr(>|t|)
───────────────────────────────────────────────────────────────
intercept Low|Medium   -0.496141  0.124541   -3.98376    0.0002
intercept Medium|High   0.690706  0.125212    5.51628    <1e-06
Infl: Medium            0.566392  0.104963    5.39611    <1e-05
Infl: High              1.28881   0.126705   10.1718     <1e-14
Type: Apartment        -0.572352  0.118747   -4.81991    <1e-05
Type: Atrium           -0.366182  0.156766   -2.33586    0.0226
Type: Terrace          -1.09101   0.151514   -7.20075    <1e-09
Cont: High              0.360284  0.0953574   3.77825    0.0003
───────────────────────────────────────────────────────────────

julia> predict(houseplr1, housing,kind=:probs)
72×3 DataFrame
 Row │ Low       Medium    High
     │ Float64?  Float64?  Float64?
─────┼──────────────────────────────
   1 │ 0.378448  0.287676  0.333876
   2 │ 0.378448  0.287676  0.333876
   3 │ 0.378448  0.287676  0.333876
(...)
1 Like