Description Usage Arguments Details Value Author(s) References See Also Examples
The function transforms a matrix of continuous numerical values into a matrix of integer (ordinal) values, with uniform marginal distributions and the desired number of categories
1 | transfmatcat(mat, cat = 3)
|
mat |
a matrix or a dataframe |
cat |
the number of categories, one for each column/variable of the matrix/dataframe |
The function converts the matrix in input, containing continuous numerical values, into a matrix of
ordinal values (1,2,3,... i.e.: Likert scale) according to the cat
-1 normal quantiles corresponding to each variable (column) of mat
.
the matrix of ordinal values
Alessandro Barbiero, Giancarlo Manzi, Pier Alda Ferrari
Ferrari P.A., Barbiero A., Manzi G.: Handling missing data in presence of ordinal variables: a new imputation procedure. In "New Perspectives in Statistical Modeling and Data Analysis", S. Ingrassia, R. Rocci, M. Vichi, Eds., Springer, 2011
Ferrari P.A., Annoni P., Barbiero A., Manzi G. (2011) An imputation method for categorical variables with application to nonlinear principal component analysis, Computational Statistics & Data Analysis, vol. 55, issue 7, pages 2410-2420, http://www.sciencedirect.com/science/article/pii/S0167947311000521
1 2 3 4 5 | # generate a 40*3 matrix from a multivariate normal r.v.
# whose independent components have mean 10 and standard deviation 4
mat<-matrix(rnorm(40,3),10,4)
# transform the matrix of normal data into a matrix of ordinal data
transfmatcat(mat, cat=c(2,3,4,3))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.