diff --git a/R/combine_estimates.R b/R/combine_estimates.R index 5ae85a0..3ffe907 100644 --- a/R/combine_estimates.R +++ b/R/combine_estimates.R @@ -4,9 +4,7 @@ # Copyright: 2023, HRDAG, GPL v2 or later # ============================================ -#' @title combine_estimates -#' -#' @description Combine MSE estimations results for a given stratum calculated +#' Combine MSE estimation results for a given stratum calculated #' using multiple replicate files created using multiple imputation. Combination #' is done using the standard approach that makes use of the laws of total #' expectation and total variance. diff --git a/R/combine_replicates.R b/R/combine_replicates.R index 0fca0ee..a6951de 100644 --- a/R/combine_replicates.R +++ b/R/combine_replicates.R @@ -4,11 +4,8 @@ # Copyright: 2023, HRDAG, GPL v2 or later # ============================================ -#' @title proportions_imputed -#' -#' @description Calculate the proportions of each level of a variable after -#' applying `combine_replicates` to complete data (that includes -#' imputed values). +#' Calculate the proportions of each level of a variable after +#' applying `combine_replicates` to complete data (includes imputed values). #' #' @param complete_data A data frame containing the output from `combine_replicates`. #' @param strata_vars A vector of column names identifying the variables to be diff --git a/R/estimate_mse.R b/R/estimate_mse.R index 7cffad7..496c964 100644 --- a/R/estimate_mse.R +++ b/R/estimate_mse.R @@ -4,9 +4,7 @@ # Copyright: 2023, HRDAG, GPL v2 or later # ============================================ -#' @title get_valid_sources -#' -#' @description Determine valid sources for estimation of a stratum of interest. +#' Determine valid sources for estimation of a stratum of interest. #' #' @param stratum_data_prepped A data frame with all records in a stratum of interest. #' Columns indicating sources should be prefixed with `in_` and should be numeric @@ -47,9 +45,7 @@ get_valid_sources <- function(stratum_data_prepped, min_n = 1) { } -#' @title run_lcmcr -#' -#' @description Calculate multiple systems estimation estimates using the Bayesian +#' Calculate multiple systems estimation estimates using the Bayesian #' Non-Parametric Latent-Class Capture-Recapture model developed by Daniel #' Manrique-Vallier (2016). #' @@ -149,9 +145,7 @@ run_lcmcr <- function(stratum_data_prepped, stratum_name, min_n = 1, } -#' @title estimates_exist -#' -#' @description Check whether stratum estimates already exist in pre-calculated files. +#' Check whether stratum estimates already exist in pre-calculated files. #' #' @param stratum_data_prepped A data frame including all records in a stratum of #' interest. The data frame should only include the source columns prefixed with @@ -159,7 +153,7 @@ run_lcmcr <- function(stratum_data_prepped, stratum_name, min_n = 1, #' @param estimates_dir Directory containing pre-calculated estimates, if you #' would like to use pre-calculated results. #' -#' #' @return A list with two entries, `estimates_exist` and `estimates_path`. +#' @return A list with two entries, `estimates_exist` and `estimates_path`. #' `estimates_exist` is a logical value indicating whether calculations for the #' stratum of interest are available in the directory containing the pre-calculated #' estimates. If `estimates_exist` is `TRUE`, `estimates_path` will contain the diff --git a/R/summary_observed.R b/R/summary_observed.R index 63f0c14..a4c8c31 100644 --- a/R/summary_observed.R +++ b/R/summary_observed.R @@ -4,10 +4,8 @@ # Copyright: 2023, HRDAG, GPL v2 or later # ============================================ -#' @title proportions_observed -#' -#' @description Calculate the proportions of each level of a variable after -#' to calculate using `summary_observed` on observed values. +#' Calculate the proportions of each level of a variable after applying +#' `summary_observed` to observed values. #' #' @param obs_data A data frame containing the output from `summary_observed`. #' @param strata_vars A vector of column names identifying the variables to be diff --git a/man/combine_estimates.Rd b/man/combine_estimates.Rd index c24a24b..11d35fa 100644 --- a/man/combine_estimates.Rd +++ b/man/combine_estimates.Rd @@ -2,7 +2,10 @@ % Please edit documentation in R/combine_estimates.R \name{combine_estimates} \alias{combine_estimates} -\title{combine_estimates} +\title{Combine MSE estimation results for a given stratum calculated +using multiple replicate files created using multiple imputation. Combination +is done using the standard approach that makes use of the laws of total +expectation and total variance.} \usage{ combine_estimates(stratum_estimates) } @@ -19,7 +22,7 @@ associated 95\% uncertainty interval (lower bound is \code{N_025}, upper bound i \code{N_975}). } \description{ -Combine MSE estimations results for a given stratum calculated +Combine MSE estimation results for a given stratum calculated using multiple replicate files created using multiple imputation. Combination is done using the standard approach that makes use of the laws of total expectation and total variance. diff --git a/man/estimates_exist.Rd b/man/estimates_exist.Rd index 081e880..44f526b 100644 --- a/man/estimates_exist.Rd +++ b/man/estimates_exist.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/estimate_mse.R \name{estimates_exist} \alias{estimates_exist} -\title{estimates_exist} +\title{Check whether stratum estimates already exist in pre-calculated files.} \usage{ estimates_exist(stratum_data_prepped, estimates_dir) } @@ -12,14 +12,15 @@ interest. The data frame should only include the source columns prefixed with \code{in_} and all columns should only contain 1's and 0's.} \item{estimates_dir}{Directory containing pre-calculated estimates, if you -would like to use pre-calculated results. - -#' @return A list with two entries, \code{estimates_exist} and \code{estimates_path}. +would like to use pre-calculated results.} +} +\value{ +A list with two entries, \code{estimates_exist} and \code{estimates_path}. \code{estimates_exist} is a logical value indicating whether calculations for the stratum of interest are available in the directory containing the pre-calculated estimates. If \code{estimates_exist} is \code{TRUE}, \code{estimates_path} will contain the full file path to the JSON file containing the estimates, otherwise it will -be \code{NA}.} +be \code{NA}. } \description{ Check whether stratum estimates already exist in pre-calculated files. diff --git a/man/get_valid_sources.Rd b/man/get_valid_sources.Rd index b44a122..2180c1f 100644 --- a/man/get_valid_sources.Rd +++ b/man/get_valid_sources.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/estimate_mse.R \name{get_valid_sources} \alias{get_valid_sources} -\title{get_valid_sources} +\title{Determine valid sources for estimation of a stratum of interest.} \usage{ get_valid_sources(stratum_data_prepped, min_n = 1) } diff --git a/man/proportions_imputed.Rd b/man/proportions_imputed.Rd index 4892c5c..54a91d0 100644 --- a/man/proportions_imputed.Rd +++ b/man/proportions_imputed.Rd @@ -2,7 +2,8 @@ % Please edit documentation in R/combine_replicates.R \name{proportions_imputed} \alias{proportions_imputed} -\title{proportions_imputed} +\title{Calculate the proportions of each level of a variable after +applying \code{combine_replicates} to complete data (includes imputed values).} \usage{ proportions_imputed(complete_data, strata_vars, digits = 2) } @@ -21,8 +22,7 @@ A data frame that contains the proportions after applying } \description{ Calculate the proportions of each level of a variable after -applying \code{combine_replicates} to complete data (that includes -imputed values). +applying \code{combine_replicates} to complete data (includes imputed values). } \examples{ local_dir <- system.file("extdata", "right", package = "verdata") diff --git a/man/proportions_observed.Rd b/man/proportions_observed.Rd index 4cee976..46456ed 100644 --- a/man/proportions_observed.Rd +++ b/man/proportions_observed.Rd @@ -2,7 +2,8 @@ % Please edit documentation in R/summary_observed.R \name{proportions_observed} \alias{proportions_observed} -\title{proportions_observed} +\title{Calculate the proportions of each level of a variable after applying +\code{summary_observed} to observed values.} \usage{ proportions_observed(obs_data, strata_vars, digits = 2) } @@ -19,8 +20,8 @@ A data frame that contains the proportions after applying \code{summary_observed}. } \description{ -Calculate the proportions of each level of a variable after -to calculate using \code{summary_observed} on observed values. +Calculate the proportions of each level of a variable after applying +\code{summary_observed} to observed values. } \examples{ local_dir <- system.file("extdata", "right", package = "verdata") diff --git a/man/run_lcmcr.Rd b/man/run_lcmcr.Rd index 18bd35c..72a4c43 100644 --- a/man/run_lcmcr.Rd +++ b/man/run_lcmcr.Rd @@ -2,7 +2,9 @@ % Please edit documentation in R/estimate_mse.R \name{run_lcmcr} \alias{run_lcmcr} -\title{run_lcmcr} +\title{Calculate multiple systems estimation estimates using the Bayesian +Non-Parametric Latent-Class Capture-Recapture model developed by Daniel +Manrique-Vallier (2016).} \usage{ run_lcmcr( stratum_data_prepped,