lmr | R Documentation |
Linear regression models (uses function lm
).
lmr(X, Y, weights = NULL)
## S3 method for class 'Lmr'
coef(object, ...)
## S3 method for class 'Lmr'
predict(object, X, ...)
X |
For the main functions: Training X-data ( |
Y |
Training Y-data ( |
weights |
Weights ( |
object |
A fitted model, output of a call to the main functions. |
... |
Optional arguments. Not used. |
See the examples.
n <- 8 ; p <- 3
X <- matrix(rnorm(n * p, mean = 10), ncol = p, byrow = TRUE)
y <- rnorm(n)
Y <- cbind(y, rnorm(n))
Xtrain <- X[1:6, ] ; Ytrain <- Y[1:6, ]
Xtest <- X[7:8, ] ; Ytest <- Y[7:8, ]
fm <- lmr(Xtrain, Ytrain)
coef(fm)
predict(fm, Xtest)
pred <- predict(fm, Xtest)$pred
msep(pred, Ytest)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.