ciperm.linreg | R Documentation |
Calculates the permutation-test based confidence interval for β_1 in the linear regression model
y = β_0 + β_1 x + ε
. Works in both for univariate and multivariate cases (but x
must be univariate).
ciperm.linreg(x, y, bounds, ...)
x |
Values of the independent variable. A numeric vector of length N. |
y |
Values of the dependent variable. A numeric vector of length N or a matrix of dim N x K. |
bounds |
Bounds forwarded to |
... |
Additional arguments to ciperm or ciperm.multi |
Vector or array of lower and upper ends of the confidence interval
ciperm, ciperm.multi
x <- runif(20, -1, 1) y <- 3 + 0.8*x + rt(20, df = 4) ciperm.linreg(x, y, bounds = c(-5, 6)) ## Multivariate example (requires package \code{mvtnorm}) library(mvtnorm) x <- runif(20, -1, 1) sigma <- matrix(0.80, 4, 4) diag(sigma) <- 1 y <- 3 + 0.8*x + rmvnorm(20, mean = rep(0,4), sigma = sigma) ciperm.linreg(x, y, bounds = c(-7, 8))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.