diff --git a/Project.toml b/Project.toml index 050d8847..fff38884 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "StatsModels" uuid = "3eaba693-59b7-5ba5-a881-562e759f1c8d" -version = "0.6.19" +version = "0.6.20" [deps] DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" diff --git a/src/statsmodel.jl b/src/statsmodel.jl index be5cd250..19e74076 100644 --- a/src/statsmodel.jl +++ b/src/statsmodel.jl @@ -34,7 +34,7 @@ end """ Wrapper for a `StatisticalModel` that has been fit from a `@formula` and tabular -data. +data. Most functions from the StatsBase API are simply delegated to the wrapped model, with the exception of functions like `fit`, `predict`, and `coefnames` where the @@ -54,7 +54,7 @@ end """ Wrapper for a `RegressionModel` that has been fit from a `@formula` and tabular -data. +data. Most functions from the StatsBase API are simply delegated to the wrapped model, with the exception of functions like `fit`, `predict`, and `coefnames` where the @@ -78,7 +78,7 @@ for (modeltype, dfmodeltype) in ((:StatisticalModel, TableStatisticalModel), function StatsBase.fit(::Type{T}, f::FormulaTerm, data, args...; contrasts::Dict{Symbol,<:Any} = Dict{Symbol,Any}(), kwargs...) where T<:$modeltype - + Tables.istable(data) || throw(ArgumentError("expected data in a Table, got $(typeof(data))")) cols = columntable(data) @@ -97,7 +97,7 @@ for (modeltype, dfmodeltype) in ((:StatisticalModel, TableStatisticalModel), end @doc """ - fit(Mod::Type{<:StatisticalModel}, f::FormulaTerm, data, args...; + fit(Mod::Type{<:StatisticalModel}, f::FormulaTerm, data, args...; contrasts::Dict{Symbol}, kwargs...) Convert tabular data into a numeric response vector and predictor matrix using @@ -120,7 +120,8 @@ const TableModels = Union{TableStatisticalModel, TableRegressionModel} StatsBase.loglikelihood, StatsBase.nullloglikelihood, StatsBase.dof, StatsBase.dof_residual, StatsBase.nobs, StatsBase.stderror, StatsBase.vcov] -@delegate TableRegressionModel.model [StatsBase.residuals, StatsBase.response, +@delegate TableRegressionModel.model [StatsBase.modelmatrix, + StatsBase.residuals, StatsBase.response, StatsBase.predict, StatsBase.predict!] StatsBase.predict(m::TableRegressionModel, new_x::AbstractMatrix; kwargs...) = predict(m.model, new_x; kwargs...)