Learn R Programming

InteractionPoweR (version 0.2.1)

norm2ordinal: norm2ordinal

Description

Transforms a vector with a normal distribution to a binomial distribution with two values.

Usage

norm2ordinal(x, k)

Value

A ordinal or binary variable

Arguments

x

Input vector

k

Number of discrete values (e.g., 2=binary, 5=likert scale)

Examples

Run this code
norm2ordinal(x = rnorm(n = 100,mean = 0,sd = 1),k=2)

Run the code above in your browser using DataLab