Description Usage Arguments Value Examples
boot_table
returns samples boostrapped from table tab
supplied. Each column of the returned table is a boostrap trial of
the corresponding column of the tab
input table.
The columns of the output table are multinomial samples with weights
proportional to corresponding columns of tab
.
1 2 | boot_table(tab, n = 1, common_depth = FALSE, common_value = NULL,
replace_zero = FALSE, replace_value = 1, round_values = FALSE)
|
tab |
(Required). A matrix or data.frame of numeric counts/weights. |
n |
(Optional). Default 1. An integer indicating the number of boostrap count tables to return. |
common_depth |
(Optional). Default |
common_value |
(Optional) The depth to use when common_depth is TRUE. Defaults to the median of the column sums in tab. |
replace_zero |
(Optional) A logical specifying whether to replace zeros in x. |
replace_value |
(Optional) The value to replace zeros with, when replace_zero is TRUE; i.e. we add a small positive weight. Default value is 1. |
round_values |
(Optional). Default FALSE. A logical scalar. Should the boostrap counts be rounded to the nearest integer? |
n
x dim(tab
)[1] x dim(tab
)[2] 3D array of
samples boostrapped from tab
.
1 2 3 4 5 6 7 | x <- matrix(sample(1:1000, 30, replace = TRUE), 5, 6)
x[1, 4] <- 0; x[2, 5] <- 0; x[4, 6] <- 0; x[1, 5] <- 0
x
boot_table(x, n = 10)
boot_table(x, common_depth = 100)
boot_table(x, common_depth = 100, n = 10, round = TRUE)
boot_table(x, common_depth = 100, n = 10, replace_zero = 0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.