standardize {brxx} | R Documentation |
standardize: Standardization of Data Matrix
Description
This function standardizes an N by P data matrix, as is strongly recommended before using any of the brxx reliability estimation functions
Usage
standardize(data)
Arguments
data |
N by P data matrix. |
Value
Returns an item level standardized data matrix.
Examples
set.seed(999)
your_data=data.frame(mvrnorm(n=20,mu=c(0,0,0,0,0,0,0),
Sigma=matrix(c(4,2,2,2,2,2,2,
2,4,2,2,2,2,2,
2,2,4,2,2,2,2,
2,2,2,4,2,2,2,
2,2,2,2,4,2,2,
2,2,2,2,2,4,2,
2,2,2,2,2,2,4),
nrow=7, ncol=7)))
your_data_miss=matrix(ncol=5,nrow=20)
for (i in 1:20){
for (p in 1:5){
your_data_miss[i,p]=ifelse(runif(1,0,1)<0.2,NA,your_data[i,p])
}
}
standardize(your_data_miss)
[Package brxx version 0.1.2 Index]