Skip to content

Commit 5444c5e

Browse files
authored
add modelmatrix method for TableRegressionModel (#211)
* add modelmatrix method for TableRegressionModel * do it via @DeleGate
1 parent da94d2b commit 5444c5e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "StatsModels"
22
uuid = "3eaba693-59b7-5ba5-a881-562e759f1c8d"
3-
version = "0.6.19"
3+
version = "0.6.20"
44

55
[deps]
66
DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"

src/statsmodel.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ end
3434

3535
"""
3636
Wrapper for a `StatisticalModel` that has been fit from a `@formula` and tabular
37-
data.
37+
data.
3838
3939
Most functions from the StatsBase API are simply delegated to the wrapped model,
4040
with the exception of functions like `fit`, `predict`, and `coefnames` where the
@@ -54,7 +54,7 @@ end
5454

5555
"""
5656
Wrapper for a `RegressionModel` that has been fit from a `@formula` and tabular
57-
data.
57+
data.
5858
5959
Most functions from the StatsBase API are simply delegated to the wrapped model,
6060
with the exception of functions like `fit`, `predict`, and `coefnames` where the
@@ -78,7 +78,7 @@ for (modeltype, dfmodeltype) in ((:StatisticalModel, TableStatisticalModel),
7878
function StatsBase.fit(::Type{T}, f::FormulaTerm, data, args...;
7979
contrasts::Dict{Symbol,<:Any} = Dict{Symbol,Any}(),
8080
kwargs...) where T<:$modeltype
81-
81+
8282
Tables.istable(data) || throw(ArgumentError("expected data in a Table, got $(typeof(data))"))
8383
cols = columntable(data)
8484

@@ -97,7 +97,7 @@ for (modeltype, dfmodeltype) in ((:StatisticalModel, TableStatisticalModel),
9797
end
9898

9999
@doc """
100-
fit(Mod::Type{<:StatisticalModel}, f::FormulaTerm, data, args...;
100+
fit(Mod::Type{<:StatisticalModel}, f::FormulaTerm, data, args...;
101101
contrasts::Dict{Symbol}, kwargs...)
102102
103103
Convert tabular data into a numeric response vector and predictor matrix using
@@ -120,7 +120,8 @@ const TableModels = Union{TableStatisticalModel, TableRegressionModel}
120120
StatsBase.loglikelihood, StatsBase.nullloglikelihood,
121121
StatsBase.dof, StatsBase.dof_residual, StatsBase.nobs,
122122
StatsBase.stderror, StatsBase.vcov]
123-
@delegate TableRegressionModel.model [StatsBase.residuals, StatsBase.response,
123+
@delegate TableRegressionModel.model [StatsBase.modelmatrix,
124+
StatsBase.residuals, StatsBase.response,
124125
StatsBase.predict, StatsBase.predict!]
125126
StatsBase.predict(m::TableRegressionModel, new_x::AbstractMatrix; kwargs...) =
126127
predict(m.model, new_x; kwargs...)

0 commit comments

Comments
 (0)