View source: R/rmsePCAandWALS.R
rmsePCAandWALS | R Documentation |
Function rmsePCAandWALS
creates table with the RMSE for each variable, for a low-rank
approximation to the correlation matrix obtained by PCA or WALS.
rmsePCAandWALS(R, output, digits = 4, diagonals = c(FALSE,FALSE,TRUE,TRUE))
R |
The correlation matrix |
output |
A list object with four approximationst to the correlation matrix |
digits |
The number of digits used in the output |
diagonals |
Vector of four logicals for omitting the diagonal of the correlation matrix for RMSE calculations. Defaults to c(FALSE,FALSE,TRUE,TRUE), to include the diagonal for PCA and exclude it for WALS |
A matrix with one row per variable and four columns for RMSE statistics.
Jan Graffelman (jan.graffelman@upc.edu)
Graffelman, J. and De Leeuw, J. (2023) Improved approximation and visualization of the correlation matrix. The American Statistician pp. 1–20. Available online as latest article doi: 10.1080/00031305.2023.2186952
FitRwithPCAandWALS
data(HeartAttack) X <- HeartAttack[,1:7] X[,7] <- log(X[,7]) colnames(X)[7] <- "logPR" R <- cor(X) ## Not run: out <- FitRwithPCAandWALS(R) Results <- rmsePCAandWALS(R,out) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.