Learn R Programming

bootstrapFP

Description

This package provides bootstrap algorithms for Finite Population inference, for estimating the variance of the Horvitz–Thompson estimator.

Installation

To install the package from CRAN, run the following code in R:

install.packages("bootstrapFP")

Or, for the development version:

# if not present, install 'devtools' package
install.packages("devtools")
devtools::install_github("rhobis/bootstrapFP")

Usage

library(bootstrapFP) 

### Generate population data ---
N   <- 20; n <- 5
x   <- rgamma(N, scale=10, shape=5)
y   <- abs( 2*x + 3.7*sqrt(x) * rnorm(N) )
pik <- n * x/sum(x)

### Draw a dummy sample ---
s  <- sample(N, n)

### Estimate bootstrap variance ---
bootstrapFP(y = y[s], pik = n/N, B=100, method = "ppSitter")
bootstrapFP(y = y[s], pik = pik[s], B=10, method = "ppHolmberg", design = 'brewer')
bootstrapFP(y = y[s], pik = pik[s], B=10, D=10, method = "ppChauvet")
bootstrapFP(y = y[s], pik = n/N, B=10, method = "dRaoWu")
bootstrapFP(y = y[s], pik = n/N, B=10, method = "dSitter")
bootstrapFP(y = y[s], pik = pik[s], B=10, method = "dAntalTille_UPS", design='brewer')
bootstrapFP(y = y[s], pik = n/N, B=10, method = "wRaoWuYue") 
bootstrapFP(y = y[s], pik = n/N, B=10, method = "wChipperfieldPreston")
bootstrapFP(y = y[s], pik = pik[s], B=10, method = "wGeneralised", distribution = 'normal')

More

  • Please, report any bug or issue here.
  • For more information, please contact the maintainer at roberto.sichera@unipa.it.

Copy Link

Version

Install

install.packages('bootstrapFP')

Monthly Downloads

185

Version

0.4.6

License

GPL-3

Maintainer

Roberto Sichera

Last Published

March 8th, 2024

Functions in bootstrapFP (0.4.6)

select_Uc

Select the random part of a pseudo-population
is_wholenumber

Check if a number is integer
bootstrapFP-package

bootstrapFP: Bootstrap Algorithms for Finite Population Inference
one_one

Select a one-one sampling
doubled_half

Select a doubled-half sampling (Antal and Tille', 2014)
AntalTille2011_ups

Antal and Tillé (2011) Bootstrap for Unequal Probability Sampling without replacement
generalised

Generalised Bootstrap
define_phi

Define the phi vector
ppBS_ups

Pseudo-population bootstrap for simple random sampling
directBS_srs

Direct bootstrap methods for simple random sampling
over_replacement

Select a simple random sampling with over-replacement
ppBS_srs

Pseudo-population bootstrap for simple random sampling
bootstrap_weights

Bootstrap with Adjusted Weights
bootstrapFP

Bootstrap algorithms for Finite Population sampling