grids_leave_n_out | R Documentation |
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.
grids_leave_n_out(x, n = 0)
grids_bootstrap(x, n = nrow(x), reps = 100, replace = TRUE)
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? |
List of grids.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.