Learn R Programming

nlmixr2extra (version 5.0.0)

optimUnisampling: Sample from uniform distribution by optim

Description

Sample from uniform distribution by optim

Usage

optimUnisampling(xvec, N = 1000, medValue, floorT = TRUE)

Value

Samples with approx desired median.

Arguments

xvec

A vector of min,max values . Ex:c(10,20)

N

Desired number of values

medValue

Desired Median

floorT

boolean indicating whether to round up

Author

Vishal Sarsani

Examples

Run this code
# Simulate 1000 creatine clearance values with median of 71.7 within range of c(6.7,140)
creatCl <- optimUnisampling(xvec=c(6.7,140), N=1000, medValue = 71.7, floorT=FALSE)

Run the code above in your browser using DataLab