View source: R/bootstrap_functions.R
lm.bal | R Documentation |
This function calculates a linear regression of y versus x. The data are bootstrapped to generate confidence intervals around the slope and intercept. Optionally, the r2 value may also be calculated. The bootstrapped prediction interval around the fit may also be calculated.
lm.bal(
x,
y,
xsd = 0,
ysd = 0,
n = 10000,
ci.width = 95,
method = c("ols", "ma", "rma"),
pred.band = T,
pred.limits = c(NA, NA),
pred.steps = 25
)
x |
x-axis values, a numeric vector |
y |
y-axis values, a numeric vector |
xsd |
(optional) Either a single value or a vector with length equal to x. Used to generate normal distributions around each x value with SD equal to xsd. |
ysd |
(optional) Either a single value or a vector with length equal to y. Used to generate normal distributions around each y value with SD equal to ysd. |
n |
Number of bootstrap replicates to perform. |
ci.width |
Width of the confidence interval to use for hypothesis testing, a single numeric value between 1 and 100 |
method |
Regression method. Either 'ols" for Ordinary Least Squares, 'ma' for Major Axis, or 'rma' for Reduced Major Axis. |
pred.band |
Compute the prediction interval? This is computationally intensive, especially for large datasets. |
pred.limits |
Lower and upper limits of the prediction interval. By default, these are the limits of the observed x-axis data. |
pred.steps |
# of steps to calculate the prediction interval at. Increase for higher resolution at cost of computation time. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.