Description Usage Arguments Value Examples
View source: R/utilities-covariance.R
Function to obtain indices in data frame for dependent & independent variables from a formula.
1 | extractIndices(formula, data, intercept)
|
formula |
An object of class 'formula' containing the desired regression formula. |
data |
A numeric data frame with at least two columns. |
intercept |
A logical vector indicating whether the intercept is
included in |
A named list with names corresponding to labels and locations (i.e., columns) for variables in the specification.
1 2 3 4 5 | y <- rnorm(100) * 2
x <- (y + rnorm(100)) > 0
data <- data.frame(cbind(y, x))
f <- as.formula('y ~ x')
extractIndices(f, data, FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.