GLM.jl icon indicating copy to clipboard operation
GLM.jl copied to clipboard

Saving LinearModel without data

Open hendri54 opened this issue 5 years ago • 5 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.

hendri54 avatar Sep 25 '19 18:09 hendri54

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.

nalimilan avatar Sep 27 '19 08:09 nalimilan

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

hendri54 avatar Sep 27 '19 12:09 hendri54

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.

pdeffebach avatar Dec 23 '19 16:12 pdeffebach

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.

palday avatar Sep 29 '22 04:09 palday

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.

nalimilan avatar Sep 29 '22 19:09 nalimilan