testLmAdjustedRSquare {rotRPackage} | R Documentation |
This ROT function, called from a Test C++ object, is given two samples, a scalar, a parameter vector and the required test level. It predicts the values corresponding to the explanatory variables through the linear model, then computes the Adjusted $R^2$. It is tested against the scalar, then the function returns the result of the test and the Adjusted $R^2$ value.
testLmAdjustedRSquare(x, beta, y, testLevel = 0.95)
x |
A m-by-n matrix containing the explanatory variables. |
beta |
A n-by-1 vector containng the linear model parameters. |
y |
A n-by-1 vector containng the response variables. |
testLevel |
the test level. (scalar in [0:1]) |
As it is not asked in LinearModel.getPredict(), no prediction interval is returned; it is up to the user to be careful about that. It is also to noted that the sample is not assumed to contain the '1's corresponding to the intercept parameter.
A list is returned, containing two scalars ,
testResult |
A scalar simulating a boolean (easier for Rserve) |
valueAdjustedRSquare |
A scalar. |
Pierre-Matthieu Pair, Softia for EDF.
set.seed(1) x <- matrix(runif(40), 10, 4) r <- matrix(c(1,2,3,4), 4, 1) y <- x %*% r + matrix(rnorm(10, 0, 0.05), 10, 1) LM <- computeLinearModel(x, y) testLmAdjustedRSquare(x, LM$parameterEstimate, y)