Learn R Programming

MonteCarloSEM (version 2.0.0)

categorize: Generates Categorical Data Sets from Continuous Data.

Description

This function transforms previously simulated continuous data sets into categorical variables based on user-specified threshold values. The function reads in existing data sets, applies the thresholding procedure to discretize the observed scores, and saves the resulting categorical data sets into the designated file location. Additionally, it produces an updated list of the newly created categorical data sets for future reference.

Usage

categorize(f.loc, threshold, dataList = "Data_List.dat")

Arguments

f.loc

A character string indicating the file path where the generated categorical data sets will be saved.

threshold

A numeric vector specifying the threshold values used to discretize the continuous data into ordered categories.

dataList

A character string giving the name of the file that contains the list of previously generated data sets.

Author

Fatih Orçan

Examples

Run this code
tres<-c(-Inf, -1.645, -.643, .643, 1.645, Inf) # five categories
categorize(f.loc=tempdir(), threshold = tres)

Run the code above in your browser using DataLab