uniboot_dep: Univariate Bootstrap

View source: R/uniboot_dep.R

uniboot_depR Documentation

Univariate Bootstrap

Description

WARNING: This function can't be used with data that is already fed through the RK function. The correlation matrix will not be positive definite.

Usage

uniboot_dep(
  data,
  B = 1000,
  groups = NULL,
  keepgroups = F,
  size = 1,
  HIcor = NULL,
  samplefrom = "group",
  use = "everything"
)

Arguments

data

The data frame to be resampled

B

The number of bootstrap samples. Alternatively "sampleframe" which will return the univariate sampling frame. "samplefrom" is not advised when there are many observations and/or many variables as the returned dataframe will be quite large.

groups

A grouping variable name

keepgroups

Should the grouping variable be kept in the final datasets?

size

The size of the bootstrap sample to be returned. Should be as a proportion and must be evenly divided into nrow(data).

HIcor

If a hypothesis imposed correlation matrix is to be used, this argument takes a list of hypothesized correlation matrices. IT MUST BE A LIST OF ONE OR MORE MATRICES. Multiple matrices can be entered in the case of grouped data (one for each group). If the nil-null correlation is to be used an identity matrix can be entered here (the same size as the appropriate correlation matrix).

samplefrom

Takes one of either "group" or "whole". When doing bootstrapping of grouped data this tells uniboot if the whole sample should be used as the sampling frame for each group (whole), or not (group). "group" should be used unless it is believed that all groups share the same underlying marginal distribution for each variable (e.g., the same mean and variance in the case of normally distributed data).

use

The missing data method for cor. Default is R's default "everything".

Value

A list of bootstrap samples

Examples

data<-TestData()
X<-uniboot(data,1000)

Omisc documentation built on Aug. 9, 2022, 5:09 p.m.

Related to uniboot_dep in Omisc...