categorize {latentFactoR} | R Documentation |
Categorize Continuous Data
Description
Categorizes continuous data based on Garrido, Abad and Ponsoda (2011; see references). Categorical data with 2 to 6 categories can include skew between -2 to 2 in increments of 0.05
Usage
categorize(data, categories, skew_value = 0)
Arguments
data |
Numeric (length = n).
A vector of continuous data with n values.
For matrices, use |
categories |
Numeric (length = 1). Number of categories to create. Between 2 and 6 categories can be used with skew |
skew_value |
Numeric (length = 1).
Value of skew.
Ranges between -2 to 2 in increments of 0.05.
Skews not in this sequence will be converted to
the nearest value in this sequence.
Defaults to |
Value
Returns a numeric vector of the categorize data
Author(s)
Maria Dolores Nieto Canaveras <mnietoca@nebrija.es>, Luis Eduardo Garrido <luisgarrido@pucmm.edu>, Hudson Golino <hfg9s@virginia.edu>, Alexander P. Christensen <alexpaulchristensen@gmail.com>
References
Garrido, L. E., Abad, F. J., & Ponsoda, V. (2011).
Performance of Velicer’s minimum average partial factor retention method with categorical variables.
Educational and Psychological Measurement, 71(3), 551-570.
Golino, H., Shi, D., Christensen, A. P., Garrido, L. E., Nieto, M. D., Sadana, R., ... & Martinez-Molina, A. (2020). Investigating the performance of exploratory graph analysis and traditional techniques to identify the number of latent factors: A simulation and tutorial. Psychological Methods, 25(3), 292-320.
Examples
# Dichotomous data (no skew)
dichotomous <- categorize(
data = rnorm(1000),
categories = 2
)
# Dichotomous data (with positive skew)
dichotomous_skew <- categorize(
data = rnorm(1000),
categories = 2,
skew_value = 1.25
)
# 5-point Likert scale (no skew)
five_likert <- categorize(
data = rnorm(1000),
categories = 5
)
# 5-point Likert scale (negative skew)
five_likert <- categorize(
data = rnorm(1000),
categories = 5,
skew_value = -0.45
)