empirical: Empirical Summary of a Simulation

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Calculates relative frequencies of the rows of a data frame.

Usage

1

Arguments

x

a data frame.

Details

The function works by adding a probs column to x with equally likely entries of 1/n, where n is the number of rows. Then it aggregates the duplicated rows of x while accumulating the probabilities associated with each.

Value

A data frame formed by aggregating the rows of x. A probs column is added giving the relative frequencies of each of the rows.

Author(s)

G. Jay Kerns gkerns@ysu.edu.

See Also

sim

Examples

1
2
3
S <- tosscoin(2, makespace = TRUE)
sims <- sim(S, ntrials = 50000)
empirical(sims)

aflaherty13/prob documentation built on May 28, 2019, 4:42 p.m.