Learn R Programming

SIMMS (version 1.3.2)

dichotomize.dataset: Dichotomize a single dataset

Description

Split a dataset into two groups by median-dichotomization

Usage

dichotomize.dataset(x, split.at = "median")

Arguments

x

A vector of values to be dichotomized

split.at

An character string or a numeric value that is be used to dichotomize. Valid values are: 'median', 'mean', or a user defined numeric threshold. Defaults to 'median'

Value

A vector of the data dichotomized onto a 0/1 (low/high) scale.

Examples

Run this code
# NOT RUN {
tmp <- rnorm(100);
tmp.groups.median <- dichotomize.dataset(tmp);
tmp.groups.mean <- dichotomize.dataset(tmp, split.at = "mean");
tmp.groups.custom <- dichotomize.dataset(tmp, split.at = 0.3);

# }

Run the code above in your browser using DataLab