lm_sampler | R Documentation |
Draw samples from a fitted linear model.
lm_sampler(fits, newdata = NULL, indices = NULL, ...)
fits |
The fitted linear model model from which to draw samples. |
newdata |
A data.frame containing new inputs from which to sample responses. If NULL, defaults to the data used to estimate fit. |
indices |
The coordinates of the response from which to draw samples. |
... |
Additional parameters passed to lm.predict |
y_star A data.frame of samples y associated with the new inputs.
fit <- lm(mpg ~ hp + wt, data = mtcars)
lm_sampler(list(f = fit))
plm <- parallelize(lm)
fit <- plm(mpg + disp ~ hp + wt, data = mtcars)
lm_sampler(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.