simegro: Simulate exponential growth

Description Usage Arguments Value Examples

View source: R/simegro.R

Description

A sandbox to simulate exponential growth with random normal error. Enter a linear scale predictor variable, x, with arguments for rate constant, k, and initial starting value of response, ylo. Include an estimate for the standard deviation, sd, in y. Random values for y are simulated by: #' 'y = ylo*exp(k*x) + rnorm(length(x), 0, sd)'. The regression formula is: 'y ~ ylo*exp(k*x)“

Usage

1
simegro(x, k, ylo, sd, reps)

Arguments

x

A vector of linear scale values, such as time..

k

The rate constant, expressed in reciprocal of the X axis units. When time, the half-life is 0.6932/k.

ylo

The lowest value of y, or a starting value.

sd

The standard deviation of y.

reps

An integer value for number of replicates.

Value

ggplot, data

Examples

1
2
3
# x is time in minutes

simegro(x=c(1:10), k=0.3, ylo=10, sd=10, reps=3)

TJMurphy/nlfitr documentation built on March 18, 2021, 12:33 p.m.