sim_pIC50: Simulate pIC50 value

Description Usage Arguments Value Examples

View source: R/sim_pIC50.R

Description

Uses the truncated normal distribution from the msm package to simulate a pIC50 value for a cell line. Incorporates genetic covariate information.

Usage

1
sim_pIC50(mu, sd, beta, g, n = 1, type = "d", lb = -4, ub = Inf)

Arguments

mu

mean of the truncated normal distribution

sd

standard deviation of the truncated normal distribution

beta

value of the genetic coefficient to recover - note that this is on a log scale

g

value of the gene (0/1 for discrete or Z-value for continuous)

n

number of data points to generate (default is 1)

type

Whether genetic covariate is a discrete (d) or continuous (c) variable

lb

lower bound of the pIC50 distribution

ub

upper bound of the pIC50 distribution

Value

numeric

Examples

1
2
3
4
5
6
library(dplyr)
set.seed(10000)
sim_pIC50(0, 1, 0, 0, type='d')
sim_pIC50(0, 1, 0, 0, n=10, type='d')
sim_cell_lines(n=10, type='d', prop=0.2) %>%
 dplyr::mutate(pIC50=sim_pIC50(0,1,beta=1,gene, n=n(), type='d'))

chapmandu2/pgxsim documentation built on May 6, 2019, 10:13 a.m.