Title: | 'Burgle': Stealing the Necessary Parts of Model Objects |
---|---|
Description: | Provides a way to reduce model objects to necessary parts, making them easier to work with, store, share and simulate multiple values for new responses while allowing for parameter uncertainty. |
Authors: | Paul R. Gunsalus [aut, cre]
|
Maintainer: | Paul R. Gunsalus <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.2 |
Built: | 2025-01-30 03:22:54 UTC |
Source: | https://github.com/cran/burgle |
Burgling what is necessary from different objects
burgle(object, ...) ## S3 method for class 'lm' burgle(object, ...) ## S3 method for class 'glm' burgle(object, ...) ## S3 method for class 'CauseSpecificCox' burgle(object, ...) ## S3 method for class 'cph' burgle(object, ...) ## S3 method for class 'flexsurvreg' burgle(object, ...) ## S3 method for class 'multinom' burgle(object, ...) ## S3 method for class 'coxph' burgle(object, ...)
burgle(object, ...) ## S3 method for class 'lm' burgle(object, ...) ## S3 method for class 'glm' burgle(object, ...) ## S3 method for class 'CauseSpecificCox' burgle(object, ...) ## S3 method for class 'cph' burgle(object, ...) ## S3 method for class 'flexsurvreg' burgle(object, ...) ## S3 method for class 'multinom' burgle(object, ...) ## S3 method for class 'coxph' burgle(object, ...)
object |
the model object to burgle |
... |
must be left empty for now |
a burgle_ object
fit <- lm(Sepal.Length ~ Sepal.Width + Petal.Length, data = iris) bfit <- burgle(fit) object.size(fit) object.size(bfit)
fit <- lm(Sepal.Length ~ Sepal.Width + Petal.Length, data = iris) bfit <- burgle(fit) object.size(fit) object.size(bfit)
Predict for burgle methods
## S3 method for class 'burgle_CauseSpecificCox' predict( object, newdata = NULL, type = "lp", cause = 1, original = TRUE, draws = 1, sims = 1, times = NULL, ... ) ## S3 method for class 'burgle_cph' predict(object, ...) ## S3 method for class 'burgle_flexsurvreg' predict( object, newdata = NA, original = TRUE, draws = 1, sims = 1, type = "lp", times = NULL, ... ) ## S3 method for class 'burgle_multinom' predict( object, newdata = NA, original = TRUE, draws = 1, sims = 1, type = "lp", floor = FALSE, seed = NULL, ... ) ## S3 method for class 'burgle_coxph' predict( object, newdata = NA, original = TRUE, draws = 1, sims = 1, type = "lp", times = NULL, ... ) ## S3 method for class 'burgle_lm' predict( object, newdata, original = TRUE, draws = 1, sims = 1, type = "lp", se = FALSE, limits = NULL, ... ) ## S3 method for class 'burgle_glm' predict( object, newdata, original = TRUE, draws = 1, sims = 1, type = "lp", se = FALSE, ... )
## S3 method for class 'burgle_CauseSpecificCox' predict( object, newdata = NULL, type = "lp", cause = 1, original = TRUE, draws = 1, sims = 1, times = NULL, ... ) ## S3 method for class 'burgle_cph' predict(object, ...) ## S3 method for class 'burgle_flexsurvreg' predict( object, newdata = NA, original = TRUE, draws = 1, sims = 1, type = "lp", times = NULL, ... ) ## S3 method for class 'burgle_multinom' predict( object, newdata = NA, original = TRUE, draws = 1, sims = 1, type = "lp", floor = FALSE, seed = NULL, ... ) ## S3 method for class 'burgle_coxph' predict( object, newdata = NA, original = TRUE, draws = 1, sims = 1, type = "lp", times = NULL, ... ) ## S3 method for class 'burgle_lm' predict( object, newdata, original = TRUE, draws = 1, sims = 1, type = "lp", se = FALSE, limits = NULL, ... ) ## S3 method for class 'burgle_glm' predict( object, newdata, original = TRUE, draws = 1, sims = 1, type = "lp", se = FALSE, ... )
object |
the results of burgle_* object |
newdata |
new data of class data.frame |
type |
either 'lp', 'response', 'link' for glm or 'risk' if time dependent |
cause |
which cause do you want to predict |
original |
whether or not to predict using the original model |
draws |
how many different models to simulate |
sims |
how many simulated response to draw |
times |
if type = "risk" time for which to predict risk, if times and sims is multiple the return will be lists within lists |
... |
for future methods |
floor |
will set the minimum odds to 0, if negative odds exists |
seed |
a seed to specificy for simulating responses (multinomial only) |
se |
whether or not to include the standard error in the simulations |
limits |
limits (minimum and maximum) for simulated response values. |
either a matrix or list of new model predictions