resampling: Resample constructs

Description Usage Arguments Value Examples

Description

The goal of resampling is to build variations of a single grid. Two variants are implemented: The first is the leave-n-out approach which builds all possible grids when dropping n constructs. The second is a bootstrap approach, randomly drawing n constructs from the grid.

Usage

1
2
3
grids_leave_n_out(x, n = 0)

grids_bootstrap(x, n = nrow(x), reps = 100, replace = TRUE)

Arguments

n

Number of constructs to drop or to sample in each generated grid.

reps

Number of grids to generate.

replace

Resample constructs with replacement?

Value

List of grids.

Examples

1
2
3
4
5
6
7
## All results for PVAFF index when one construct is left out 
p <- indexPvaff(boeker)
l <- grids_leave_n_out(boeker, n = 1)
pp <- sapply(l, indexPvaff)  # apply indexPvaff function to all grids
range(pp)   # min and max PVAFF
hist(pp, xlab = "PVAFF values")    # visualize
abline(v = p, col = "blue", lty = 2)

markheckmann/OpenRepGrid documentation built on April 30, 2021, 2:33 a.m.