boot_prop_vector: Boostrap a vector of proportions

Description Usage Arguments Value Examples

View source: R/bootstrap.R

Description

boot_prop_vector returns n samples of boostraped vector of proportions. It draws a Dirichlet sample with parameter x. If depth is supplied, the samples are scaled to have sum equal to depth.

Usage

1
2
boot_prop_vector(x, n = 1, depth = NULL, replace_zeros = FALSE,
  replace_value = 1)

Arguments

x

(Required). A vector of counts.

n

(Optional). Default 1. An integer indicating the number of boostrap count vectors to return.

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.

replace_zero

(Optional) A logical specifying whether to replace zeros in x.

Value

A vector or a matrix of n vectors boostrapped from x.

Examples

1
2
3
y <- runif(10)
y <- y / sum(y)
boot_prop_vector(y, n = 4, replace_zero = 0.05)

krisrs1128/mvarVis documentation built on Oct. 13, 2019, 11:14 p.m.