Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: irxforge
Title: Forging data for pharmacometric analyses
Version: 0.0.0.9002
Version: 0.0.0.9003
Authors@R: c(
person("Ron", "Keizer", email = "ron@insight-rx.com", role = c("cre", "aut")),
person("Michael", "McCarthy", email = "michael.mccarthy@insight-rx.com", role = "ctb"),
Expand Down
15 changes: 13 additions & 2 deletions R/sample_covariates_mvtnorm.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
#' Sample covariates from multivariate normal distributions
#'
#' Samples from a multivariate normal distribution either derived from observed
#' data or specified directly via `means` plus a covariance matrix (`sigma`) or
#' standard deviations (`sd`).
#' `data` or specified directly via `means` plus a covariance matrix (`sigma`)
#' or standard deviations (`sd`).
#'
#' The `conditional` argument` can be specified only when data is used as input
#' (and not with `means` and `sigma or `sd``). If `conditional`` is used in
#' conjuction with `data``, it will first downsample the provided dataset to
#' include only patients that match the conditional. After that, it will get
#' the covariance matrix from the downsampled dataset, and draw samples from
#' it. It is therefore possible that, in contrast to e.g. bootstrap sampling,
#' samples are drawn that are outside of the min/max given in the conditional.
#'
#' @param data data.frame (n x p) containing the original, observed,
#' time-invariant covariates (ID should not be included) that will be used to
Expand Down Expand Up @@ -71,6 +79,9 @@ sample_covariates_mvtnorm <- function(
if (!is.null(data)) {
warning("`data` is ignored when `means` is provided.")
}
if(!is.null(conditional)) {
warning("`conditional` is ignored when `means` is provided.")
}
if (is.null(sigma) && is.null(sd)) {
stop("When `means` is supplied, either `sigma` or `sd` must also be provided.")
}
Expand Down
11 changes: 9 additions & 2 deletions man/sample_covariates_mvtnorm.Rd

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

Loading