powered by
Draw samples from a fitted linear model.
lm_sampler(fits, newdata = NULL, indices = NULL, ...)
y_star A data.frame of samples y associated with the new inputs.
The fitted linear model model from which to draw samples.
A data.frame containing new inputs from which to sample responses. If NULL, defaults to the data used to estimate fit.
The coordinates of the response from which to draw samples.
Additional parameters passed to lm.predict
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)
Run the code above in your browser using DataLab