jipApprox

R 패키지 메타데이터와 수집 신호를 모아 봅니다.

Packages / CRAN / jipApprox

jipApprox

v0.1.5
Repository CRANLicense GPL-3Lifecycle activeNeeds compilation no
DOI
10.32614/CRAN.package.jipApprox

Core Signals

첫 화면에서 판단해야 할 수집 신호를 먼저 배치합니다.

0
표시할 핵심 신호가 없습니다.

Supported Backends

DESCRIPTION에서 감지한 backend 관련 package입니다.

0
backend package 신호가 없습니다.

Quick Facts

기본 메타데이터를 작은 카드와 토큰으로 압축합니다.

profile
Repository
CRAN
Version
0.1.5
License
GPL-3
Lifecycle
active
Needs compilation
no
Last observed
2026-05-30
CRAN
cran.r-project.org/package=jipApprox

수집 소스별 패키지 정보

1개 소스
CRAN
0.1.5
2026-05-30
License
GPL-3
Depends
R (>= 4.0.0)
Imports
sampling
Needs compilation
no
Lifecycle
active
Last observed
2026-05-30 10:45:11

이 패키지가 의존하는 패키지

1개 표시전체 1개
PackageTypeSpec
sampling
CRAN · 0.1.5 · 2026-05-30
Importssampling
1 / 1

이 패키지를 쓰는 패키지

0개 표시전체 0개
PackageTypeSpec
표시할 dependency edge가 없습니다.
1 / 1

패키지 페이지

All links
18
Repository
CRAN
Version
0.1.5
Collected
2026-05-27 03:56:09
Package page
https://cran.r-project.org/web/packages/jipApprox/index.html
DOI
10.32614/CRAN.package.jipApprox
CRAN checks
https://cran.r-project.org/web/checks/check_results_jipApprox.html
README
https://cran.r-project.org/web/packages/jipApprox/readme/README.html
Reference HTML
https://cran.r-project.org/web/packages/jipApprox/refman/jipApprox.html
Reference PDF
https://cran.r-project.org/web/packages/jipApprox/jipApprox.pdf
Source package
https://cran.r-project.org/src/contrib/jipApprox_0.1.5.tar.gz
Archive
https://CRAN.R-project.org/src/contrib/Archive/jipApprox
Page fields
Author
Roberto Sichera [aut, cre]
BugReports
https://github.com/rhobis/jipApprox/issues
CRAN Checks
jipApprox results
DOI
10.32614/CRAN.package.jipApprox
License
GPL-3
Maintainer
Roberto Sichera <rob.sichera at gmail.com>
Materials
README
NeedsCompilation
no
Old Sources
jipApprox archive
Package Source
jipApprox_0.1.5.tar.gz
Published
2023-08-26
Reference Manual
jipApprox.html , jipApprox.pdf
Version
0.1.5
Windows Binaries
r-devel: jipApprox_0.1.5.zip , r-release: jipApprox_0.1.5.zip , r-oldrel: jipApprox_0.1.5.zip
MacOS Binaries
r-release (arm64): jipApprox_0.1.5.tgz , r-oldrel (arm64): jipApprox_0.1.5.tgz , r-release (x86_64): jipApprox_0.1.5.tgz , r-oldrel (x86_64): jipApprox_0.1.5.tgz
Version
0.1.5
Published
2023-08-26
DOI
10.32614/CRAN.package.jipApprox
Author
Roberto Sichera [aut, cre]
Maintainer
Roberto Sichera <rob.sichera at gmail.com>
BugReports
https://github.com/rhobis/jipApprox/issues
License
GPL-3
NeedsCompilation
no
Materials
README
CRAN Checks
jipApprox results
Reference Manual
jipApprox.html , jipApprox.pdf
Package Source
jipApprox_0.1.5.tar.gz
Windows Binaries
r-devel: jipApprox_0.1.5.zip , r-release: jipApprox_0.1.5.zip , r-oldrel: jipApprox_0.1.5.zip
MacOS Binaries
r-release (arm64): jipApprox_0.1.5.tgz , r-oldrel (arm64): jipApprox_0.1.5.tgz , r-release (x86_64): jipApprox_0.1.5.tgz , r-oldrel (x86_64): jipApprox_0.1.5.tgz
Old Sources
jipApprox archive
Page sections 3
Documentation
Heading
Documentation
Links
[{"label":"jipApprox.html","section":"","type":"","url":"https://cran.r-project.org/web/packages/jipApprox/refman/jipApprox.html"},{"label":"jipApprox.pdf","section":"","type":"","url":"https://cran.r-project.org/web/packages/jipApprox/jipApprox.pdf"}]
Text
Reference manual: jipApprox.html , jipApprox.pdf
Downloads
Heading
Downloads
Links
[{"label":"jipApprox_0.1.5.tar.gz","section":"","type":"","url":"https://cran.r-project.org/src/contrib/jipApprox_0.1.5.tar.gz"},{"label":"jipApprox_0.1.5.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.7/jipApprox_0.1.5.zip"},{"label":"jipApprox_0.1.5.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.6/jipApprox_0.1.5.zip"},{"label":"jipApprox_0.1.5.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.5/jipApprox_0.1.5.zip"},{"label":"jipApprox_0.1.5.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/sonoma-arm64/contrib/4.6/jipApprox_0.1.5.tgz"},{"label":"jipApprox_0.1.5.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-arm64/contrib/4.5/jipApprox_0.1.5.tgz"},{"label":"jipApprox_0.1.5.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.6/jipApprox_0.1.5.tgz"},{"label":"jipApprox_0.1.5.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.5/jipApprox_0.1.5.tgz"},{"label":"jipApprox archive","section":"","type":"","url":"https://CRAN.R-project.org/src/contrib/Archive/jipApprox"}]
Text
Package source: jipApprox_0.1.5.tar.gz Windows binaries: r-devel: jipApprox_0.1.5.zip , r-release: jipApprox_0.1.5.zip , r-oldrel: jipApprox_0.1.5.zip macOS binaries: r-release (arm64): jipApprox_0.1.5.tgz , r-oldrel (arm64): jipApprox_0.1.5.tgz , r-release (x86_64): jipApprox_0.1.5.tgz , r-oldrel (x86_64): jipApprox_0.1.5.tgz Old sources: jipApprox archive
Linking
Heading
Linking
Links
[{"label":"https://CRAN.R-project.org/package=jipApprox","section":"","type":"","url":"https://CRAN.R-project.org/package=jipApprox"}]
Text
Please use the canonical form https://CRAN.R-project.org/package=jipApprox to link to this page.
Materials 1
Documentation 2
Downloads 9
All page links 18

패키지 문서 원문

3 artifacts
field
README
CRAN · 0.1.5 · Materials · text/html · 13,212 · 2026-05-07
Title
README
Label
README
Text content
Text content
README code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} pre > code.sourceCode { white-space: pre; position: relative; } pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } div.sourceCode { margin: 1em 0; } pre.sourceCode { margin: 0; } @media screen { div.sourceCode { overflow: auto; } } @media print { pre > code.sourceCode { white-space: pre-wrap; } pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } } pre.numberSource code { counter-reset: source-line 0; } pre.numberSource code > span { position: relative; left: -4em; counter-increment: source-line; } pre.numberSource code > span > a:first-child::before { content: counter(source-line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding: 0 4px; width: 4em; color: #aaaaaa; } pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } div.sourceCode { } @media screen { pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } } code span.al { color: #ff0000; font-weight: bold; } /* Alert */ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ code span.at { color: #7d9029; } /* Attribute */ code span.bn { color: #40a070; } /* BaseN */ code span.bu { color: #008000; } /* BuiltIn */ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ code span.ch { color: #4070a0; } /* Char */ code span.cn { color: #880000; } /* Constant */ code span.co { color: #60a0b0; font-style: italic; } /* Comment */ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ code span.do { color: #ba2121; font-style: italic; } /* Documentation */ code span.dt { color: #902000; } /* DataType */ code span.dv { color: #40a070; } /* DecVal */ code span.er { color: #ff0000; font-weight: bold; } /* Error */ code span.ex { } /* Extension */ code span.fl { color: #40a070; } /* Float */ code span.fu { color: #06287e; } /* Function */ code span.im { color: #008000; font-weight: bold; } /* Import */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ code span.kw { color: #007020; font-weight: bold; } /* Keyword */ code span.op { color: #666666; } /* Operator */ code span.ot { color: #007020; } /* Other */ code span.pp { color: #bc7a00; } /* Preprocessor */ code span.sc { color: #4070a0; } /* SpecialChar */ code span.ss { color: #bb6688; } /* SpecialString */ code span.st { color: #4070a0; } /* String */ code span.va { color: #19177c; } /* Variable */ code span.vs { color: #4070a0; } /* VerbatimString */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ jipApprox Description This package provides functions to approximate joint-inclusion probabilities in Unequal Probability Sampling, or to find Monte Carlo approximations of first and second-order inclusion probabilities of a general sampling design. The main functions are: jip_approx() : returns a matrix of approximated joint-inclusion probabilities for unequal probability sampling design with high entropy; jip_MonteCarlo() : produces a matrix of first and second order inclusion probabilities for a given sampling design, approximated through Monte Carlo simulation. This method of approximation is more flexible but also computer-intensive. HTvar() : returns the Horvitz-Thompson or Sen-Yates-Grundy variance or their estimates, computed using true inclusion probabilities or an approximation obtained by jip_approx() or jip_MonteCarlo() . Installation The development version of the package can be installed from GitHub: # if not present, install 'devtools' package install.packages ( "devtools" ) devtools :: install_github ( "rhobis/jipApprox" ) Usage library (jipApprox) ### Generate population data --- N <- 20 ; n <- 5 set.seed ( 0 ) x <- rgamma ( 500 , scale= 10 , shape= 5 ) y <- abs ( 2 * x + 3.7 * sqrt (x) * rnorm (N) ) pik <- n * x / sum (x) ### Approximate joint-inclusion probabilities for high entropy designs --- pikl <- jip_approx (pik, method= 'Hajek' ) pikl <- jip_approx (pik, method= 'HartleyRao' ) pikl <- jip_approx (pik, method= 'Tille' ) pikl <- jip_approx (pik, method= 'Brewer1' ) pikl <- jip_approx (pik, method= 'Brewer2' ) pikl <- jip_approx (pik, method= 'Brewer3' ) pikl <- jip_approx (pik, method= 'Brewer4' ) ### Approximate inclusion probabilities through Monte Carlo simulation --- pikl <- jip_MonteCarlo ( x= pik, n = n, replications = 100 , design = "brewer" ) pikl <- jip_MonteCarlo ( x= pik, n = n, replications = 100 , design = "tille" ) pikl <- jip_MonteCarlo ( x= pik, n = n, replications = 100 , design = "poisson" ) pikl <- jip_MonteCarlo ( x= pik, n = n, replications = 100 , design = "maxEntropy" ) pikl <- jip_MonteCarlo ( x= pik, n = n, replications = 100 , design = "randomSystematic" ) pikl <- jip_MonteCarlo ( x= pik, n = n, replications = 100 , design = "systematic" ) pikl <- jip_MonteCarlo ( x= pik, n = n, replications = 100 , design = "sampford" ) More Please, report any bug or issue here . For more information, please contact the maintainer at rob.sichera@gmail.com .
reference_manual_html
Reference manual HTML
CRAN · 0.1.5 · Documentation · text/html · 34,092 · 2026-05-07
Title
Help for package jipApprox
Label
Reference manual HTML
Text content
Text content
Help for package jipApprox const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"}; function processMathHTML() { var l = document.getElementsByClassName('reqn'); for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); } return; } Package {jipApprox} Contents jipApprox-package HTvar brewer excludeSSU is.wholenumber jipDFtoM jipMtoDF jip_Brewer jip_Hajek jip_HartleyRao jip_MonteCarlo jip_Tille jip_approx maxEntropy pre_CPS pre_tille sampford save_output tille Title: Approximate Inclusion Probabilities for Survey Sampling Version: 0.1.5 Date: 2023-08-26 Description: Approximate joint-inclusion probabilities in Unequal Probability Sampling, or compute Monte Carlo approximations of the first and second-order inclusion probabilities of a general sampling design as in Fattorini (2006) < doi:10.1093/biomet/93.2.269 >. Depends: R (≥ 4.0.0) License: GPL-3 Encoding: UTF-8 BugReports: https://github.com/rhobis/jipApprox/issues RoxygenNote: 7.2.3 Imports: sampling NeedsCompilation: no Packaged: 2023-08-26 08:11:03 UTC; Roberto Author: Roberto Sichera [aut, cre] Maintainer: Roberto Sichera <rob.sichera@gmail.com> Repository: CRAN Date/Publication: 2023-08-26 08:40:02 UTC jipApprox: Approximate inclusion probabilities for survey sampling Description Approximate joint-inclusion probabilities in Unequal Probability Sampling, or compute Monte Carlo approximations of the first and second-order inclusion probabilities of a general sampling design as in Fattorini (2006) <doi:10.1093/biomet/93.2.269>. Approximation of Joint-inclusion probabilities Function jip_approx provides a number of approximations of the second-order inclusion probabilities that require only the first-order inclusion probabilities. These approximations may be employed in unequal probability sampling design with high entropy. A more flexible approximation may be obtained by using function jip_MonteCarlo , which estimates inclusion probabilities through a Monte Carlo simulation. The variance of the Horvitz-Thompson total estimator may be then estimated by plugging the approximated joint probabilities into the Horvitz-Thompson or Sen-Yates-Grundy variance estimator using function HTvar . Author(s) Maintainer : Roberto Sichera rob.sichera@gmail.com References Matei, A.; Tillé, Y., 2005. Evaluation of variance approximations and estimators in maximum entropy sampling with unequal probability and fixed sample size. Journal of Official Statistics 21 (4), 543-570. Haziza, D.; Mecatti, F.; Rao, J.N.K. 2008. Evaluation of some approximate variance estimators under the Rao-Sampford unequal probability sampling design. Metron LXVI (1), 91-108. Fattorini, L. 2006. Applying the Horvitz-Thompson criterion in complex designs: A computer-intensive perspective for estimating inclusion probabilities. Biometrika 93 (2), 269-278 See Also Useful links: Report bugs at https://github.com/rhobis/jipApprox/issues Variance of the Horvitz-Thompson estimator Description Compute or estimate the variance of the Horvitz-Thompson total estimator by the Horvitz-Thompson or Sen-Yates-Grundy variance estimators. Usage HTvar(y, pikl, sample = TRUE, method = "HT") Arguments y numeric vector representing the variable of interest pikl matrix of second-order (joint) inclusion probabilities; the diagonal must contain the first-order inclusion probabilities. sample logical value indicating whether sample or population values are provided. If sample=TRUE , the function returns a sample estimate of the variance, while if sample=FALSE , the Variance is computed over all population units. Default is TRUE. method string, indicating if the Horvitz-Thompson ( "HT" ) or the Sen-Yates-Grundy ( "SYG" ) estimator should be computed. Details The Horvitz-Thompson variance is defined as \sum_{i\in U}\sum_{j \in U} \frac{(\pi_{ij} - \pi_i\pi_j)}{\pi_i\pi_j} y_i y_j which is estimated by \sum_{i\in U}\sum_{j \in U} \frac{(\pi_{ij} - \pi_i\pi_j)}{\pi_i\pi_j\pi_{ij}} y_i y_j The Sen-Yates-Grundy variance is obtained from the Horvitz-Thompson variance by conditioning on the sample size n, and is therefore only appliable to fixed size sampling designs: \sum_{i\in U}\sum_{j > i} (\pi_i\pi_j - \pi_{ij}) \Biggl(\frac{y_i}{\pi_i} - \frac{y_j}{\pi_j} \Biggr)^2 Its estimator is \sum_{i\in U}\sum_{j > i} \frac{(\pi_i\pi_j - \pi_{ij})}{\pi_{ij}} \Biggl(\frac{y_i}{\pi_i} - \frac{y_j}{\pi_j} \Biggr)^2 Examples ### Generate population data --- N <- 500; n <- 50 set.seed(0) x <- rgamma(500, scale=10, shape=5) y <- abs( 2*x + 3.7*sqrt(x) * rnorm(N) ) pik <- n * x/sum(x) pikl <- jip_approx(pik, method='Hajek') ### Dummy sample --- s <- sample(N, n) ### Compute Variance --- HTvar(y=y, pikl=pikl, sample=FALSE, method="HT") HTvar(y=y, pikl=pikl, sample=FALSE, method="SYG") ### Estimate Variance --- #' HTvar(y=y[s], pikl=pikl[s,s], sample=TRUE, method="HT") #' HTvar(y=y[s], pikl=pikl[s,s], sample=TRUE, method="SYG") Brewer sampling procedure ————————————————– Description Brewer sampling procedure ————————————————– Usage brewer(pik, n, N, s, list) Arguments pik vector of first-order inclusion probabilities n sample size N population size s vector of length N, with 1s at the positions of self-selecting units list vector with positions of self selcting units Note this function is a modified version of function UPbrewer , from the sampling package. Exclude self-selecting units Description Exclude self-selecting units and units with probability zero and returns a list with parameters needed to perform sampling Usage excludeSSU(pik, eps = 1e-06) Arguments pik vector of first-order inclusion probabilities eps control value for pik Note the code is taken from package sampling Check if a number is integer Description Check if x is an integer number, differently from is.integer , which checks the type of the object x Usage is.wholenumber(x, tol = .Machine$double.eps^0.5) Arguments x a scalar or a numeric vector tol a scalar, indicating the tolerance Note From the help page of function is.integer Transform a Joint-Inclusion Probability data.frame to a matrix Description Transform a Joint-Inclusion Probability data.frame to a matrix Usage jipDFtoM(jip, symmetric = TRUE) Arguments jip vector or data.frame containing the joint-inclusion probabilities symmetric boolean, if TRUE , returns a symmetric matrix, otherwise, an upper triangular matrix Value a symmetric matrix of joint-inclusion probabilities if TRUE , otherwise, an upper triangular matrix Transform a matrix of Joint-Inclusion Probabilities to a data.frame Description Transform a matrix of Joint-Inclusion Probabilities to a data.frame Usage jipMtoDF(jip, id = NULL) Arguments jip a square matrix of joint-inclusion probabilities, symmetric or upper-triangular id optional, vector of id labels, its length should be equal to ncol(jip) and nrow(jip) Brewer's joint-inclusion probability approximations Description Approximation of joint inclusion probabilities by one of the estimators proposed by Brewer and Donadio (2003) Usage jip_Brewer(pik, method) Arguments pik numeric vector of first-order inclusion probabilities for all population units. method string representing one of the available approximation methods. Details "Brewer18" is the approximation showed in equation (18) of Brewer and Donadio (2003) Hájek's joint-inclusion probability approximation Description Estimate joint-inclusion probabilities using Hájek (1964) equation Usage jip_Hajek(pik) Arguments pik numeric vector of first-order inclusion probabilities for all population units. Hartley-Rao approximation of joint-inclusion probabilities Description Approximation of joint-inclusion probabilities with precision of order O(N^{-4}) for the random systematic sampling design by Hartley and Rao (1962), pag. 369 eq. 5.15 Usage jip_HartleyRao(pik) Arguments pik numeric vector of first-order inclusion probabilities for all population units. Approximate inclusion
section
jipApprox.pdf
CRAN · 0.1.5 · Documentation · application/pdf · 199,944 · 2026-05-07
Title
jipApprox.pdf
Label
jipApprox.pdf

Reference for jipApprox (0.1.5)

19개 topic
HTvar
Variance of the Horvitz-Thompson estimator
CRAN · 0.1.5 · jipApprox/man/HTvar.Rd · 2026-05-07

Compute or estimate the variance of the Horvitz-Thompson total estimator by the Horvitz-Thompson or Sen-Yates-Grundy variance estimators.

Aliases
HTvar
Usage
HTvar(y, pikl, sample = TRUE, method = "HT")
Arguments
y
numeric vector representing the variable of interest
pikl
matrix of second-order (joint) inclusion probabilities; the diagonal must contain the first-order inclusion probabilities.
sample
logical value indicating whether sample or population values are provided. If sample=TRUE, the function returns a sample estimate of the variance, while if sample=FALSE, the Variance is computed over all population units. Default is TRUE.
method
string, indicating if the Horvitz-Thompson ("HT") or the Sen-Yates-Grundy ("SYG") estimator should be computed.
Details
The Horvitz-Thompson variance is defined as _i U_j U (_ij - _i_j)_i_j y_i y_j _U _U [ (ij) - (i)(j) ] y(i) y(j) / [ (i)(j) ] which is estimated by _i U_j U (_ij - _i_j)_i_j_ij y_i y_j _s _s [ (ij) - (i)(j) ] y(i) y(j) / [ (i)(j)(ij) ] The Sen-Yates-Grundy variance is obtained from the Horvitz-Thompson variance by conditioning on the sample size n, and is therefore only appliable to fixed size sampling designs: _i U_j > i (_i_j - _ij) (y_i_i - y_j_j )^2 __U_j > i [ (i)(j) - (ij) ] [ y(i)/(i) - y(j)/(j) ]^2 Its estimator is _i U_j > i (_i_j - _ij)_ij (y_i_i - y_j_j )^2 __U_j > i [ (i)(j) - (ij) ] [ y(i)/(i) - y(j)/(j) ]^2 / (ij)
Examples
### Generate population data --- N <- 500; n <- 50 set.seed(0) x <- rgamma(500, scale=10, shape=5) y <- abs( 2*x + 3.7*sqrt(x) * rnorm(N) ) pik <- n * x/sum(x) pikl <- jip_approx(pik, method='Hajek') ### Dummy sample --- s <- sample(N, n) ### Compute Variance --- HTvar(y=y, pikl=pikl, sample=FALSE, method="HT") HTvar(y=y, pikl=pikl, sample=FALSE, method="SYG") ### Estimate Variance --- #' HTvar(y=y[s], pikl=pikl[s,s], sample=TRUE, method="HT") #' HTvar(y=y[s], pikl=pikl[s,s], sample=TRUE, method="SYG")
brewer
Brewer sampling procedure --------------------------------------------------
CRAN · 0.1.5 · jipApprox/man/brewer.Rd · 2026-05-07

Brewer sampling procedure --------------------------------------------------

Aliases
brewer
Keywords
internal
Usage
brewer(pik, n, N, s, list)
Arguments
pik
vector of first-order inclusion probabilities
n
sample size
N
population size
s
vector of length N, with 1s at the positions of self-selecting units
list
vector with positions of self selcting units
Note
this function is a modified version of function [sampling]UPbrewer, from the sampling package.
excludeSSU
Exclude self-selecting units
CRAN · 0.1.5 · jipApprox/man/excludeSSU.Rd · 2026-05-07

Exclude self-selecting units and units with probability zero and returns a list with parameters needed to perform sampling

Aliases
excludeSSU
Keywords
internal
Usage
excludeSSU(pik, eps = 1e-06)
Arguments
pik
vector of first-order inclusion probabilities
eps
control value for pik
Note
the code is taken from package sampling
is.wholenumber
Check if a number is integer
CRAN · 0.1.5 · jipApprox/man/is.wholenumber.Rd · 2026-05-07

Check if x is an integer number, differently from is.integer, which checks the type of the object x

Aliases
is.wholenumber
Keywords
internal
Usage
is.wholenumber(x, tol = .Machine$double.eps^0.5)
Arguments
x
a scalar or a numeric vector
tol
a scalar, indicating the tolerance
Note
From the help page of function [base]is.integer
jipApprox-package
jipApprox: Approximate inclusion probabilities for survey sampling
CRAN · 0.1.5 · package · jipApprox/man/jipApprox-package.Rd · 2026-05-07

Approximate joint-inclusion probabilities in Unequal Probability Sampling, or compute Monte Carlo approximations of the first and second-order inclusion probabilities of a general sampling design as in Fattorini (2006) <doi:10.1093/biomet/93.2.269>.

Aliases
jipApproxjipApprox-package
See also
Useful links: Report bugs at https://github.com/rhobis/jipApprox/issues
Custom sections
Approximation of Joint-inclusion probabilities
Function jip_approx provides a number of approximations of the second-order inclusion probabilities that require only the first-order inclusion probabilities. These approximations may be employed in unequal probability sampling design with high entropy. A more flexible approximation may be obtained by using function jip_MonteCarlo, which estimates inclusion probabilities through a Monte Carlo simulation. The variance of the Horvitz-Thompson total estimator may be then estimated by plugging the approximated joint probabilities into the Horvitz-Thompson or Sen-Yates-Grundy variance estimator using function HTvar.
Author
Maintainer: Roberto Sichera rob.sichera@gmail.com
References
Matei, A.; Tillé, Y., 2005. Evaluation of variance approximations and estimators in maximum entropy sampling with unequal probability and fixed sample size. Journal of Official Statistics 21 (4), 543-570. Haziza, D.; Mecatti, F.; Rao, J.N.K. 2008. Evaluation of some approximate variance estimators under the Rao-Sampford unequal probability sampling design. Metron LXVI (1), 91-108. Fattorini, L. 2006. Applying the Horvitz-Thompson criterion in complex designs: A computer-intensive perspective for estimating inclusion probabilities. Biometrika 93 (2), 269-278
jipDFtoM
Transform a Joint-Inclusion Probability data.frame to a matrix
CRAN · 0.1.5 · jipApprox/man/jipDFtoM.Rd · 2026-05-07

Transform a Joint-Inclusion Probability data.frame to a matrix

Aliases
jipDFtoM
Usage
jipDFtoM(jip, symmetric = TRUE)
Arguments
jip
vector or data.frame containing the joint-inclusion probabilities
symmetric
boolean, if TRUE, returns a symmetric matrix, otherwise, an upper triangular matrix
Value
a symmetric matrix of joint-inclusion probabilities if TRUE, otherwise, an upper triangular matrix
jipMtoDF
Transform a matrix of Joint-Inclusion Probabilities to a data.frame
CRAN · 0.1.5 · jipApprox/man/jipMtoDF.Rd · 2026-05-07

Transform a matrix of Joint-Inclusion Probabilities to a data.frame

Aliases
jipMtoDF
Usage
jipMtoDF(jip, id = NULL)
Arguments
jip
a square matrix of joint-inclusion probabilities, symmetric or upper-triangular
id
optional, vector of id labels, its length should be equal to ncol(jip) and nrow(jip)
jip_Brewer
Brewer's joint-inclusion probability approximations
CRAN · 0.1.5 · jipApprox/man/jip_Brewer.Rd · 2026-05-07

Approximation of joint inclusion probabilities by one of the estimators proposed by Brewer and Donadio (2003)

Aliases
jip_Brewer
Keywords
internal
Usage
jip_Brewer(pik, method)
Arguments
pik
numeric vector of first-order inclusion probabilities for all population units.
method
string representing one of the available approximation methods.
Details
"Brewer18" is the approximation showed in equation (18) of Brewer and Donadio (2003)
jip_Hajek
Hájek's joint-inclusion probability approximation
CRAN · 0.1.5 · jipApprox/man/jip_Hajek.Rd · 2026-05-07

Estimate joint-inclusion probabilities using Hájek (1964) equation

Aliases
jip_Hajek
Keywords
internal
Usage
jip_Hajek(pik)
Arguments
pik
numeric vector of first-order inclusion probabilities for all population units.
jip_HartleyRao
Hartley-Rao approximation of joint-inclusion probabilities
CRAN · 0.1.5 · jipApprox/man/jip_HartleyRao.Rd · 2026-05-07

Approximation of joint-inclusion probabilities with precision of order O(N^-4) for the random systematic sampling design by Hartley and Rao (1962), pag. 369 eq. 5.15

Aliases
jip_HartleyRao
Keywords
internal
Usage
jip_HartleyRao(pik)
Arguments
pik
numeric vector of first-order inclusion probabilities for all population units.
jip_MonteCarlo
Approximate inclusion probabilities by Monte Carlo simulation
CRAN · 0.1.5 · jipApprox/man/jip_MonteCarlo.Rd · 2026-05-07

Approximate first and second-order inclusion probabilities by means of Monte Carlo simulation. Estimates are obtained as proportion of the number of occurrences of each unit or couple of units over the total number of replications. One unit is added to both numerator and denominator to assure strict positivity of estimates (Fattorini, 2006).

Aliases
jip_MonteCarlo
Usage
jip_MonteCarlo( x, n, replications = 1e+06, design, units, seed = NULL, as_data_frame = FALSE, design_pars, write_on_file = FALSE, filename, path, by = NULL, progress_bar = TRUE )
Arguments
x
size measure or first-order inclusion probabilities, a vector or single-column data.frame
n
sample size (for fixed-size designs), or expected sample size (for Poisson sampling)
replications
numeric value, number of independent Monte Carlo replications
design
sampling procedure to be used for sample selection. Either a string indicating the name of the sampling design or a function; see section "Details" for more information.
units
indices of units for which probabilities have to be estimated. Optional, if missing, estimates are produced for the whole population
seed
a valid seed value for reproducibility
as_data_frame
logical, should output be in a data.frame form? if FALSE, a matrix is returned
design_pars
only used when a function is passed to argument design, named list of parameters to pass to the sampling design function.
write_on_file
logical, should output be written on a text file?
filename
string indicating the name of the file to create on disk, must include the .txt extension; only applies if write_on_file = TRUE.
path
string indicating the path to the directory where the output file should be created; only applies if write_on_file = TRUE.
by
optional; integer scalar indicating every how many replications a partial output should be saved
progress_bar
logical, indicating whether a progress bar is desired
Details
Argument design accepts either a string indicating the sampling design to use to draw samples or a function. Accepted designs are "brewer", "tille", "maxEntropy", "poisson", "sampford", "systematic", "randomSystematic". The user may also pass a function as argument; such function should take as input the parameters passed to argument design_pars and return either a logical vector or a vector of 0s and 1s, where TRUE or 1 indicate sampled units and FALSE or 0 indicate non-sample units. The length of such vector must be equal to the length of x if units is not specified, otherwise it must have the same length of units. When write_on_file = TRUE, specifying a value for aurgument by will produce intermediate files with approximate inclusion probabilities every by number of replications. E.g., if replications=1e06 and by=5e05, two output files will be created: one with estimates at 5e05 and one at 1e06 replications. This option is particularly useful to assess convergence of the estimates.
Value
A matrix of estimated inclusion probabilities if as_data_frame=FALSE, otherwise a data.frame with three columns: the first two indicate the ids of the the couple of units, while the third one contains the joint-inclusion probability values. Please, note that when as_data_frame=TRUE, first-order inclusion probabilities are not returned.
Examples
### Generate population data --- N <- 20; n<-5 set.seed(0) x <- rgamma(N, scale=10, shape=5) y <- abs( 2*x + 3.7*sqrt(x) * rnorm(N) ) pik <- n * x/sum(x) ### Approximate joint-inclusion probabilities pikl <- jip_MonteCarlo(x=pik, n = n, replications = 100, design = "brewer") pikl <- jip_MonteCarlo(x=pik, n = n, replications = 100, design = "tille") pikl <- jip_MonteCarlo(x=pik, n = n, replications = 100, design = "maxEntropy") pikl <- jip_MonteCarlo(x=pik, n = n, replications = 100, design = "randomSystematic") pikl <- jip_MonteCarlo(x=pik, n = n, replications = 100, design = "systematic") pikl <- jip_MonteCarlo(x=pik, n = n, replications = 100, design = "sampford") pikl <- jip_MonteCarlo(x=pik, n = n, replications = 100, design = "poisson") #Use an external function to draw samples pikl <- jip_MonteCarlo(x=pik, n=n, replications=100, design = sampling::UPmidzuno, design_pars = list(pik=pik)) #Write output on file after 50 and 100 replications pikl <- jip_MonteCarlo(x=pik, n = n, replications = 100, design = "brewer", write_on_file = TRUE, filename="test.txt", path=tempdir(), by = 50 )
References
Fattorini, L. 2006. Applying the Horvitz-Thompson criterion in complex designs: A computer-intensive perspective for estimating inclusion probabilities. Biometrika 93 (2), 269–278
jip_Tille
Tillé's approximation of joint-inclusion probabilities
CRAN · 0.1.5 · jipApprox/man/jip_Tille.Rd · 2026-05-07

Compute the approximation of joint-inclusion probabilities by means of the Iterative Proportional Fitting Procedure (IPFP) proposed by Tillé (1996)

Aliases
jip_Tille
Keywords
internal
Usage
jip_Tille(pik, eps = 1e-06, maxIter = 1000)
Arguments
pik
numeric vector of first-order inclusion probabilities for all population units.
eps
tolerance value for the convergence of the fixed-point procedure
maxIter
a scalar indicating the maximum number of iterations for the fixed-point procedure
jip_approx
Approximate Joint-Inclusion Probabilities
CRAN · 0.1.5 · jipApprox/man/jip_approx.Rd · 2026-05-07

Approximations of joint-inclusion probabilities by means of first-order inclusion probabilities.

Aliases
jip_approx
Usage
jip_approx(pik, method)
Arguments
pik
numeric vector of first-order inclusion probabilities for all population units.
method
string representing one of the available approximation methods.
Details
Available methods are "Hajek", "HartleyRao", "Tille", "Brewer1","Brewer2","Brewer3", and "Brewer4". Note that these methods were derived for high-entropy sampling designs, therefore they could have low performance under different designs. Hájek (1964) approximation [method="Hajek"] is derived under Maximum Entropy sampling design and is given by _ij = _i_j 1 - (1-_i)(1-_j)d (ij) = (i) (j) (1 - ( 1-(i) )( 1 -(j) ) ) /d where d = _i U _i(1-_i) d = (i)(1-(i)) Hartley and Rao (1962) proposed the following approximation under randomised systematic sampling [method="HartleyRao"]: _ij = n-1n _i_j + n-1n^2 (_i^2 _j + _i _j^2) - n-1n^3_i_j _i U _j^2 + 2(n-1)n^3 (_i^3 _j + _i_j^3 + _i^2 _j^2) - 3(n-1)n^4 (_i^2 _j + _i_j^2) _i U_i^2 + 3(n-1)n^5 _i_j ( _i U _i^2 )^2 - 2(n-1)n^4 _i_j _i U _j^3 *see pdf version of documentation* Tillé (1996) proposed the approximation _ij = _i_j(ij) = _i _j, where the coefficients _i are computed iteratively through the following procedure [method="Tille"]: _i^(0) = _i, \,\, i U(0) = , i = 1, ..., N _i^(2k-1) = (n-1)_i^(2k-2) - _i^(2k-2) (2k-1) = ( (n-1) )/((2k-2) - (2k-2)) _i^2k = _i^(2k-1) ( n(n-1)(^(2k-1))^2 - _i U (_k^(2k-1))^2 )^(1/2) (2k) = (2k-1) ( n(n-1) / ( ((2k-1))^2 - ( (2k-1)^2 ) ) )^(1/2) with ^(k) = _i U _i^i, \,\, k=1,2,3, Finally, Brewer (2002) and Brewer and Donadio (2003) proposed four approximations, which are defined by the general form _ij = _i_j (c_i + c_j)/2 (ij) = (i)(j) [c(i) + c(j) ]/2 where the c_i determine the approximation used: Equation (9) [method="Brewer1"]: c_i = (n-1) / (n-_i)c(i) = [n-1] / [n-(i) ] Equation (10) [method="Brewer2"]: c_i = (n-1) / (n- n^-1_i U_i^2 )c(i) = [n-1] / [n- _U (i)^2 / n ] Equation (11) [method="Brewer3"]: c_i = (n-1) / (n - 2_i + n^-1_i U_i^2 )c(i) = [n-1] / [n- 2(i) + _U (i)^2 / n ] Equation (18) [method="Brewer4"]: c_i = (n-1) / (n - (2n-1)(n-1)^-1_i + (n-1)^-1_i U_i^2 ) c(i) = [n-1] / [n- (i)(2n -1)/(n-1) + _U (i)^2 / (n-1) ]
Value
A symmetric matrix of inclusion probabilities, which diagonal is the vector of first-order inclusion probabilities.
Examples
### Generate population data --- N <- 20; n<-5 set.seed(0) x <- rgamma(N, scale=10, shape=5) y <- abs( 2*x + 3.7*sqrt(x) * rnorm(N) ) pik <- n * x/sum(x) ### Approximate joint-inclusion probabilities --- pikl <- jip_approx(pik, method='Hajek') pikl <- jip_approx(pik, method='HartleyRao') pikl <- jip_approx(pik, method='Tille') pikl <- jip_approx(pik, method='Brewer1') pikl <- jip_approx(pik, method='Brewer2') pikl <- jip_approx(pik, method='Brewer3') pikl <- jip_approx(pik, method='Brewer4')
References
Hartley, H.O.; Rao, J.N.K., 1962. Sampling With Unequal Probability and Without Replacement. The Annals of Mathematical Statistics 33 (2), 350-374. Hájek, J., 1964. Asymptotic Theory of Rejective Sampling with Varying Probabilities from a Finite Population. The Annals of Mathematical Statistics 35 (4), 1491-1523. Tillé, Y., 1996. Some Remarks on Unequal Probability Sampling Designs Without Replacement. Annals of Economics and Statistics 44, 177-189. Brewer, K.R.W.; Donadio, M.E., 2003. The High Entropy Variance of the Horvitz-Thompson Estimator. Survey Methodology 29 (2), 189-196.
maxEntropy
Conditional Poisson Sampling (maximum entropy sampling)
CRAN · 0.1.5 · jipApprox/man/maxEntropy.Rd · 2026-05-07

Draw a sample by means of Conditional Poisson Sampling

Aliases
maxEntropy
Keywords
internal
Usage
maxEntropy(pik, N, q)
Arguments
pik
vector of first-order inclusion probabilities
N
population size (excluding self-selecting units)
q
matrix of selection probabilities, computed by means of function UPMEsfromq() of package sampling.
Note
this functions is a modified version of function [sampling]UPmaxentropy, in the sampling package.
pre_CPS
Conditional Poisson Sampling - compute selection probabilities
CRAN · 0.1.5 · jipApprox/man/pre_CPS.Rd · 2026-05-07

Compute matrix of selection probabilities for Conditional Poisson Sampling

Aliases
pre_CPS
Keywords
internal
Usage
pre_CPS(pik)
Arguments
pik
vector of first-order inclusion probabilities
Note
this functions is a modified version of function [sampling]UPmaxentropy, in the sampling package.
pre_tille
Tillé's elimination procedure - elimination probabilities
CRAN · 0.1.5 · jipApprox/man/pre_tille.Rd · 2026-05-07

Computes a matrix with elimination probabilities for each step of Tillé's elimination procedure

Aliases
pre_tille
Keywords
internal
Usage
pre_tille(pik)
Arguments
pik
vector of first-order inclusion probabilities
sampford
Rao-Sampford sampling
CRAN · 0.1.5 · jipApprox/man/sampford.Rd · 2026-05-07

Draw a sample by means of Rao-Sampford sampling

Aliases
sampford
Keywords
internal
Usage
sampford(pik, n, N, s, list)
Arguments
pik
vector of first-order inclusion probabilities
n
sample size
N
population size (excluding self-selecting units)
s
vector of length N, with 1s at the positions of self-selecting units
list
vector with positions of self selcting units
Note
this function is a modified version of function [sampling]UPsampford, in the sampling package.
save_output
Save partial results
CRAN · 0.1.5 · jipApprox/man/save_output.Rd · 2026-05-07

Write joint inclusion probability estimates on a file every by replications

Aliases
save_output
Keywords
internal
Usage
save_output( iteration, design_name, counts, units, filename, path, status, as_data_frame )
Arguments
iteration
integer indicating the iterations the simulation is at
design_name
string indicating the name of the sampling design to include in the filename
counts
matrix with number of occurrences of couple of units up to current replication
units
id of units for which output should be saved
filename
name of the file to write on disk
path
path to the directory where the file should be saved
status
1 if partial results are written before the maximum number of replications is reached, 0 otherwise
as_data_frame
logical, should output be in form of a data frame?
tille
Tillé's elimination procedure
CRAN · 0.1.5 · jipApprox/man/tille.Rd · 2026-05-07

Draw a sample by means of Tillé's elimination procedure

Aliases
tille
Keywords
internal
Usage
tille(pik, n, N, s, list, pmat)
Arguments
pik
vector of first-order inclusion probabilities
n
sample size (excluding self-selecting units)
N
population size (excluding self-selecting units)
s
vector of length N, with 1s at the positions of self-selecting units
list
vector with positions of self selcting units
pmat
matrix of dimension $(N-n)xN, where each row has elimination probabilities for population units for one step of the procedure.

버전 이력

RepositoryVersionPublishedFirst seenLast seenDocs
CRAN0.1.52026-05-292026-05-30

보안

표시할 OSV 데이터가 없습니다.

문헌 신호

표시할 OpenAlex 데이터가 없습니다.