Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/add-hyperlinks' into test-strati…
Browse files Browse the repository at this point in the history
…fy-data
  • Loading branch information
d-morrison committed Jul 15, 2024
2 parents 59df654 + d1d3a8c commit ee1f434
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion R/est.incidence.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' This function models seroincidence using maximum likelihood estimation; that is, it finds the value of the seroincidence parameter which maximizes the likelihood (i.e., joint probability) of the data.
#' @inheritParams log_likelihood
#' @inheritParams stats::nlm
#' @param pop_data [data.frame] with cross-sectional serology data per antibody and age, and additional columns
#' @param pop_data a [data.frame] with cross-sectional serology data per antibody and age, and additional columns
#' @param lambda_start starting guess for incidence rate, in years/event.
#' @param antigen_isos Character vector with one or more antibody names. Values must match `pop_data`
#' @param build_graph whether to graph the log-likelihood function across a range of incidence rates (lambda values)
Expand Down
13 changes: 9 additions & 4 deletions R/est.incidence.by.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@
#' Function to estimate seroincidences based on cross-section serology data and longitudinal
#' response model.
#'
#' @param pop_data [data.frame] with cross-sectional serology data per antibody and age, and additional columns to identify possible `strata`.
#' @param strata [character] vector of stratum-defining variables. Values must be variable names in `pop_data`.
#' @param pop_data a [data.frame] with cross-sectional serology data per antibody and age, and additional columns corresponding to each element of the `strata` input
#' @param strata a [character] vector of stratum-defining variables. Values must be variable names in `pop_data`.
#' @param curve_strata_varnames A subset of `strata`. Values must be variable names in `curve_params`. Default = "".
#' @param noise_strata_varnames A subset of `strata`. Values must be variable names in `noise_params`. Default = "".
#' @param num_cores Number of processor cores to use for calculations when computing by strata. If set to more than 1 and package \pkg{parallel} is available, then the computations are executed in parallel. Default = 1L.

#' @details
#'
#' If `strata` is left empty, a warning will be produced, recommending that you use [est.incidence()] for unstratified analyses, and then the data will be passed to `est.incidence()`. If for some reason you want to use `est.incidence.by()` with no strata instead of calling `est.incidence()`, you may use `NA`, `NULL`, or "" as the `strata` argument to avoid that warning.
#' If `strata` is left empty, a warning will be produced,
#' recommending that you use [est.incidence()] for unstratified analyses,
#' and then the data will be passed to [est.incidence()].
#' If for some reason you want to use [est.incidence.by()]
#' with no strata instead of calling [est.incidence()],
#' you may use `NA`, `NULL`, or `""` as the `strata` argument to avoid that warning.
#'
#'
#' @inheritParams est.incidence
Expand Down Expand Up @@ -44,7 +49,7 @@
#' curve_params = curve,
#' noise_params = noise %>% filter(Country == "Pakistan"),
#' antigen_isos = c("HlyE_IgG", "HlyE_IgA"),
#' #num_cores = 8 # Allow for parallel processing to decrease run time,
#' #num_cores = 8 # Allow for parallel processing to decrease run time
#' iterlim = 5 # limit iterations for the purpose of this example
#' )
#'
Expand Down
2 changes: 1 addition & 1 deletion man/est.incidence.Rd

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

13 changes: 9 additions & 4 deletions man/est.incidence.by.Rd

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

0 comments on commit ee1f434

Please sign in to comment.