grids_leave_n_out {OpenRepGrid}R Documentation

Resample constructs

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

grids_leave_n_out(x, n = 0)

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

Arguments

x

A repgrid object.

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

## 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)

[Package OpenRepGrid version 0.1.15 Index]