Part 10 Best Practices

astsa as an example of interactively useful but programmatically a pain

  • Show your example data in the README so users immediately see the structure
  • Model classes beyond lists

best practices: type definitions of methods for most functions

as soon as there is a recipe interface for GLMs that’s all i’m ever going to use

habit: get the df right, then y ~ . in the formula. would be nice to still see the features in the call?

Every modeling function should include its package version in its data object I will now save my models as a list of three objects: model, data, and sessioninfo::session_info()

Should be easy to get the values plotted so others can make their own plots

modelling packages: - vignette should include not only the coefficients as output in an example, but also those coefficients written up as a general latex model and as a latex model with those specific coefficients substituted in

TWO DISTINCT ISSUES THAT GET RESOLVED IN FORMULAE:

  • design matrix specification
  • model specification. (a la fGarch::garchFit(~arma(1, 1) + garch(1, 0)))

where is the appropriate space in my framework to specify the arma and garch parameters? i.e. we specify these as models rather than model families, (although specifying one as a model family could be interesting as well)

calls to fit should be pure: i.e. no side effects like plotting, and especially no plotting with invisible object return

function to write out model form and fitted model in latex for sanity checking: some sort of model_report / model_form generic

TODO: LASSO EXAMPLE of wanting to use the coefficients for prediction vs wanting to see the order in which features enter the model

variable and model specification should happen in formulas, multiple formulas if necessary - need better tools (or documentation of existing tools): extracting and using the information found in formulae

plm package: use of multiple formula sections in same formula to specify instrumental regression vs survey pacakge: use of multiple formulas in separate arguments