34
34
35
35
"""
36
36
Wrapper for a `StatisticalModel` that has been fit from a `@formula` and tabular
37
- data.
37
+ data.
38
38
39
39
Most functions from the StatsBase API are simply delegated to the wrapped model,
40
40
with the exception of functions like `fit`, `predict`, and `coefnames` where the
54
54
55
55
"""
56
56
Wrapper for a `RegressionModel` that has been fit from a `@formula` and tabular
57
- data.
57
+ data.
58
58
59
59
Most functions from the StatsBase API are simply delegated to the wrapped model,
60
60
with the exception of functions like `fit`, `predict`, and `coefnames` where the
@@ -78,7 +78,7 @@ for (modeltype, dfmodeltype) in ((:StatisticalModel, TableStatisticalModel),
78
78
function StatsBase. fit (:: Type{T} , f:: FormulaTerm , data, args... ;
79
79
contrasts:: Dict{Symbol,<:Any} = Dict {Symbol,Any} (),
80
80
kwargs... ) where T<: $modeltype
81
-
81
+
82
82
Tables. istable (data) || throw (ArgumentError (" expected data in a Table, got $(typeof (data)) " ))
83
83
cols = columntable (data)
84
84
@@ -97,7 +97,7 @@ for (modeltype, dfmodeltype) in ((:StatisticalModel, TableStatisticalModel),
97
97
end
98
98
99
99
@doc """
100
- fit(Mod::Type{<:StatisticalModel}, f::FormulaTerm, data, args...;
100
+ fit(Mod::Type{<:StatisticalModel}, f::FormulaTerm, data, args...;
101
101
contrasts::Dict{Symbol}, kwargs...)
102
102
103
103
Convert tabular data into a numeric response vector and predictor matrix using
@@ -120,7 +120,8 @@ const TableModels = Union{TableStatisticalModel, TableRegressionModel}
120
120
StatsBase. loglikelihood, StatsBase. nullloglikelihood,
121
121
StatsBase. dof, StatsBase. dof_residual, StatsBase. nobs,
122
122
StatsBase. stderror, StatsBase. vcov]
123
- @delegate TableRegressionModel. model [StatsBase. residuals, StatsBase. response,
123
+ @delegate TableRegressionModel. model [StatsBase. modelmatrix,
124
+ StatsBase. residuals, StatsBase. response,
124
125
StatsBase. predict, StatsBase. predict!]
125
126
StatsBase. predict (m:: TableRegressionModel , new_x:: AbstractMatrix ; kwargs... ) =
126
127
predict (m. model, new_x; kwargs... )
0 commit comments