Description Usage Arguments Details Author(s) Examples
Allows user to supply data frame with mean parameter values and a SD or CV information for these parameters. Function processes each column (corresponding e.g. to different species) and draws from a normal or log-normal distribution with same mean and appropriate SD/CV>
1 2 3 4 5 | introduce_variability(input.mean,
input.sd=NULL,
cv=NULL,
log = FALSE,
input.name.col = "Parameter")
|
input.mean |
Input data frame with the means. |
input.sd |
Input data frame with SDs for each of the elements (same dimension as numerical part of input.mean). |
cv |
(Named) vector of coefficients of variation. Names should correspond to parameter names specified by input.name.col. |
log |
Whether draws should be made from log-normal distribution. If not, normal will be used. |
input.name.col |
Column in input.mean storing names of parameters. |
...
Witold Wiecek / LA-SER
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | monte.carlo.cv = c("Total Body Water" = .3,
"Plasma Volume" = .3,
"Cardiac Output" = .3,
"Average BW" = .16,
"Total Plasma Protein" = .14,
"Plasma albumin"= .1,
"Plasma a-1-AGP"= .3,
"Hematocrit"= .3,
"Urine"= .3,
"Bile"= .3,
"GFR"=.3,
"Average Body Temperature" = 0)
ll <- list()
for(i in 1:10000)
ll[[i]] <- introduce_variability(input.mean = physiology.data,
cv = monte.carlo.cv,
log = TRUE)[["Human"]]
ll2 <- list()
for(i in 1:10000)
ll2[[i]] <- introduce_variability(input.mean = physiology.data,
cv = monte.carlo.cv,
log = FALSE)[["Human"]]
physiology.data[["Human"]]
apply(do.call(rbind, ll), 1, mean)
apply(do.call(rbind, ll), 2, mean)
apply(do.call(rbind, ll), 1, sd)
apply(do.call(rbind, ll), 2, sd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.