Learn R Programming

equate (version 2.0.8)

sample.freqtab: Bootstrap Random Sampling from Frequency Tables

Description

An extension of sample to objects of class “freqtab” for bootstrap sampling.

Usage

sample.freqtab(x, size = sum(x), replace = TRUE)

Arguments

x

object of class “freqtab”, which is an array of counts across one or more numeric dimensions.

size

non-negative integer giving the sample size.

replace

logical with default TRUE indicating whether sampling should be with replacement.

Value

A table array, as a “freqtab” object, sampled from the original x.

See Also

table, ftable, summary.freqtab, plot.freqtab

Examples

Run this code
# NOT RUN {
# Sample with replacement from ACT math and compare results
set.seed(2021)
rx <- as.freqtab(ACTmath[, 1:2])
rxs <- sample.freqtab(rx)
summary(rx)
summary(rxs)

# }

Run the code above in your browser using DataLab