Skip to content

Commit

Permalink
Merge pull request #31 from HRDAG/function-docs
Browse files Browse the repository at this point in the history
Updates to function documentation.

Closes #22
Closes #23 
Closes #24 
Closes #25
  • Loading branch information
thegargiulian committed Oct 25, 2023
2 parents 89898c5 + 520e844 commit 191629c
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 37 deletions.
4 changes: 1 addition & 3 deletions R/combine_estimates.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 2 additions & 5 deletions R/combine_replicates.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 4 additions & 10 deletions R/estimate_mse.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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).
#'
Expand Down Expand Up @@ -149,17 +145,15 @@ 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
#' `in_` and all columns should only contain 1's and 0's.
#' @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
Expand Down
6 changes: 2 additions & 4 deletions R/summary_observed.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions man/combine_estimates.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions man/estimates_exist.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_valid_sources.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/proportions_imputed.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions man/proportions_observed.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/run_lcmcr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 191629c

Please sign in to comment.