From 7ac224d8bafc1f9dbf9e2c91f0e9f3a4267a38cc Mon Sep 17 00:00:00 2001 From: "Zimmer, Stephanie" Date: Fri, 8 May 2026 11:51:11 -0400 Subject: [PATCH] Update manuals based on feedback on win-builder --- DESCRIPTION | 4 ++-- R/allocate.R | 16 ++++++++-------- man/SampleSelectR-package.Rd | 3 ++- man/allocate.Rd | 18 +++++++++--------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0f52a51..76af138 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: SampleSelectR -Title: Randomly select samples for various probability-based methods +Title: Randomly Select Samples for Various Probability-Based Methods Version: 1.0.0 Authors@R: c( person("Stephanie", "Zimmer", , "sazimmer@rti.org", role = c("aut", "cre")), @@ -13,7 +13,7 @@ Description: Randomly select samples with SRS, systematic, and various PPS metho License: GPL (>= 3) Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 Depends: R (>= 4.1.0) Imports: diff --git a/R/allocate.R b/R/allocate.R index e21684b..ef17285 100644 --- a/R/allocate.R +++ b/R/allocate.R @@ -21,10 +21,10 @@ #' \item Optimal allocation #' \itemize{ #' \item cost-constrained \[\code{N.h, S.h, c.h, cost, allocation = "optimal"}\] -#' \deqn{n_h = (C−c_0) \times \frac{N_h S_h / \sqrt{c_h}}{\sum\limits_{h=1}^H N_h S_h \sqrt{c_h}}} +#' \deqn{n_h = (C-c_0) \times \frac{N_h S_h / \sqrt{c_h}}{\sum\limits_{h=1}^H N_h S_h \sqrt{c_h}}} #' where \cr #' \eqn{c_h}: cost per unit in stratum \emph{h} (function input is \code{c.h}), and \cr -#' \eqn{(C – c_0)}: total variable cost (function input is \code{cost}) +#' \eqn{(C - c_0)}: total variable cost (function input is \code{cost}) #' \item precision-constrained \[\code{N.h, S.h, c.h, variance, allocation = "optimal"}\] #' \deqn{n_h = N_h S_h / \sqrt{c_h} \times \frac{\sum\limits_{h=1}^H N_h S_h \sqrt{c_h}}{V_0 \left(\sum\limits_{h=1}^H N_h \right)^2 + \sum\limits_{h=1}^H N_h S_h^2}} #' where \cr @@ -36,11 +36,11 @@ #' #' \tabular{lllllllll}{ #' \strong{allocation} \tab \strong{N.h} \tab \strong{n.samp} \tab \strong{S.h} \tab \strong{c.h} \tab \strong{cost} \tab \strong{variance} \tab \strong{lbound} \tab \strong{power} \cr -#' proportional \tab ✓ \tab ✓ \tab \tab \tab \tab \tab ✓ \tab \cr -#' power \tab ✓ \tab ✓ \tab \tab \tab \tab \tab ✓ \tab ✓\cr -#' neyman \tab ✓ \tab ✓ \tab ✓ \tab ✓ \tab \tab \tab ✓ \tab \cr -#' optimal: cost-constrained \tab ✓ \tab \tab ✓ \tab ✓ \tab ✓ \tab \tab ✓ \tab \cr -#' optimal: precision-constrained \tab ✓ \tab \tab ✓ \tab ✓ \tab \tab ✓ \tab ✓ \tab +#' proportional \tab X \tab X \tab \tab \tab \tab \tab X \tab \cr +#' power \tab X \tab X \tab \tab \tab \tab \tab X \tab X\cr +#' neyman \tab X \tab X \tab X \tab X \tab \tab \tab X \tab \cr +#' optimal: cost-constrained \tab X \tab \tab X \tab X \tab X \tab \tab X \tab \cr +#' optimal: precision-constrained \tab X \tab \tab X \tab X \tab \tab X \tab X \tab #' } #' #' @param allocation type of allocation, must be one of \code{"proportional"}, \code{"power"}, \code{"neyman"}, or \code{"optimal"}. @@ -52,7 +52,7 @@ #' required for the following allocation types: Neyman, and optimal, and \code{NULL} otherwise. #' @param c.h vector of cost per unit in stratum h (positive values same length as \code{N.h}) (\eqn{c_h}). \cr\cr #' required for the optimal allocation only, and \code{NULL} otherwise. -#' @param cost total variable cost (positive value) \eqn{(C – c_0)}. \cr\cr +#' @param cost total variable cost (positive value) \eqn{(C - c_0)}. \cr\cr #' required for the cost-constrained optimal allocation only, and \code{NULL} otherwise. #' @param variance fixed variance target for estimated mean (positive value) (\eqn{V_0}). \cr\cr #' required for the precision-constrained optimal allocation only, and \code{NULL} otherwise. diff --git a/man/SampleSelectR-package.Rd b/man/SampleSelectR-package.Rd index ec80e39..38c2449 100644 --- a/man/SampleSelectR-package.Rd +++ b/man/SampleSelectR-package.Rd @@ -4,7 +4,7 @@ \name{SampleSelectR-package} \alias{SampleSelectR} \alias{SampleSelectR-package} -\title{SampleSelectR: Randomly select samples for various probability-based methods} +\title{SampleSelectR: Randomly Select Samples for Various Probability-Based Methods} \description{ Randomly select samples with SRS, systematic, and various PPS methods. Also includes functionality to select within strata and allocate sample sizes. } @@ -12,6 +12,7 @@ Randomly select samples with SRS, systematic, and various PPS methods. Also incl Useful links: \itemize{ \item \url{https://github.com/RTIInternational/SampleSelectR} + \item \url{https://rtiinternational.github.io/SampleSelectR/} \item Report bugs at \url{https://github.com/RTIInternational/SampleSelectR/issues} } diff --git a/man/allocate.Rd b/man/allocate.Rd index fa719d4..9823997 100644 --- a/man/allocate.Rd +++ b/man/allocate.Rd @@ -31,7 +31,7 @@ required for the following allocation types: Neyman, and optimal, and \code{NULL \item{c.h}{vector of cost per unit in stratum h (positive values same length as \code{N.h}) (\eqn{c_h}). \cr\cr required for the optimal allocation only, and \code{NULL} otherwise.} -\item{cost}{total variable cost (positive value) \eqn{(C – c_0)}. \cr\cr +\item{cost}{total variable cost (positive value) \eqn{(C - c_0)}. \cr\cr required for the cost-constrained optimal allocation only, and \code{NULL} otherwise.} \item{variance}{fixed variance target for estimated mean (positive value) (\eqn{V_0}). \cr\cr @@ -68,10 +68,10 @@ where \cr \item Optimal allocation \itemize{ \item cost-constrained [\code{N.h, S.h, c.h, cost, allocation = "optimal"}] -\deqn{n_h = (C−c_0) \times \frac{N_h S_h / \sqrt{c_h}}{\sum\limits_{h=1}^H N_h S_h \sqrt{c_h}}} - where \cr +\deqn{n_h = (C-c_0) \times \frac{N_h S_h / \sqrt{c_h}}{\sum\limits_{h=1}^H N_h S_h \sqrt{c_h}}} +where \cr \eqn{c_h}: cost per unit in stratum \emph{h} (function input is \code{c.h}), and \cr -\eqn{(C – c_0)}: total variable cost (function input is \code{cost}) +\eqn{(C - c_0)}: total variable cost (function input is \code{cost}) \item precision-constrained [\code{N.h, S.h, c.h, variance, allocation = "optimal"}] \deqn{n_h = N_h S_h / \sqrt{c_h} \times \frac{\sum\limits_{h=1}^H N_h S_h \sqrt{c_h}}{V_0 \left(\sum\limits_{h=1}^H N_h \right)^2 + \sum\limits_{h=1}^H N_h S_h^2}} where \cr @@ -83,11 +83,11 @@ The table below presents the relevant inputs for each type; when irrelevant inpu \tabular{lllllllll}{ \strong{allocation} \tab \strong{N.h} \tab \strong{n.samp} \tab \strong{S.h} \tab \strong{c.h} \tab \strong{cost} \tab \strong{variance} \tab \strong{lbound} \tab \strong{power} \cr -proportional \tab ✓ \tab ✓ \tab \tab \tab \tab \tab ✓ \tab \cr -power \tab ✓ \tab ✓ \tab \tab \tab \tab \tab ✓ \tab ✓\cr -neyman \tab ✓ \tab ✓ \tab ✓ \tab ✓ \tab \tab \tab ✓ \tab \cr -optimal: cost-constrained \tab ✓ \tab \tab ✓ \tab ✓ \tab ✓ \tab \tab ✓ \tab \cr -optimal: precision-constrained \tab ✓ \tab \tab ✓ \tab ✓ \tab \tab ✓ \tab ✓ \tab +proportional \tab X \tab X \tab \tab \tab \tab \tab X \tab \cr +power \tab X \tab X \tab \tab \tab \tab \tab X \tab X\cr +neyman \tab X \tab X \tab X \tab X \tab \tab \tab X \tab \cr +optimal: cost-constrained \tab X \tab \tab X \tab X \tab X \tab \tab X \tab \cr +optimal: precision-constrained \tab X \tab \tab X \tab X \tab \tab X \tab X \tab } }