JuliaStats / GLM.jl

Generalized linear models in Julia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Saving LinearModel without data

hendri54 opened this issue · comments

I would find it useful to implement the analogue to Matlab's CompactLinearModel. This is essentially a LinearModel without data.

I envision the following (common?) workflow:

  • Run a large number of regressions.
  • Store the results (without storing the potentially large data many times).
  • When all results are in, decide how to present selected regressions in tables.

One could, of course, extract selected information from each LinearModel and store it in a different format. The drawback would be that packages such as PrettyTables expect LinearModels as inputs.

I guess such objects would have to store a few statistics that cannot be computed without the data, or they wouldn't be very useful: that includes deviance, log-likelihood, p-values...

There could be an AbstractLinearModel type that PrettyTables would use instead of LinearModel.

I agree.
Also, I should have referred to RegressionTables.jl instead of PrettyTables.

I think this is a good idea. We could also add a method that contains just the information printed in coeftable plus a few others like dof etc.

I've been tinkering with something similar for MixedModels.jl in the form of a MixedModelSummary over in MixedModelsSerialization.jl.

We could probably define a sensible RegressionModelSummary interface for stored coefficients, (optionally) associated names and formula / coeftable as well as various summary statistics and potentially the variance-covariance matrix.

Seems like the existing RegressionModel interface would be enough? The difference with a full LinearModel is just that methods that would require access to the full data (e.g. fitted) would throw an error.