Learn R Programming

wakefield (version 0.3.9)

level: Generate Random Vector of Levels

Description

level - Generate a random vector of integer levels (1-4).

math - Generate a random vector of integer mathematics levels (1-4) similar to New York State grades 3-8 assessment results.

ela - Generate a random vector of integer English language arts (ELA) levels (1-4) similar to New York State grades 3-8 assessment results.

Usage

level(n, x = 1:4, prob = NULL, name = "Level")

math(n, x = 1:4, prob = c(0.29829, 0.33332, 0.22797, 0.14042), name = "Math")

ela(n, x = 1:4, prob = c(0.3161, 0.37257, 0.2233, 0.08803), name = "ELA")

Value

Returns a random vector of integer levels (1-4) elements.

Arguments

n

The number elements to generate. This can be globally set within the environment of r_data_frame or r_list.

x

A vector of elements to chose from.

prob

A vector of probabilities to chose from.

name

The name to assign to the output vector's varname attribute. This is used to auto assign names to the column/vector name when used inside of r_data_frame or r_list.

Details

Distribution of levels (used in prob) were taken from New York State's 2014 assessment report: https://www.nysed.gov/information-reporting-services

LevelELAMath
131.6%29.8%
237.3%33.3%
322.3%22.8%
48.8%14.0%

See Also

Other variable functions: age(), animal(), answer(), area(), car(), children(), coin(), color(), date_stamp(), death(), dice(), dna(), dob(), dummy(), education(), employment(), eye(), grade(), grade_level(), group(), hair(), height(), income(), internet_browser(), iq(), language, likert(), lorem_ipsum(), marital(), military(), month(), name, normal(), political(), race(), religion(), sat(), sentence(), sex(), sex_inclusive(), smokes(), speed(), state(), string(), upper(), valid(), year(), zip_code()

Examples

Run this code
level(10)
barplot(table(level(10000, prob = probs(4))))

math(10)
barplot(table(math(10000)))

ela(10)
barplot(table(ela(10000)))

Run the code above in your browser using DataLab