rnorm.by.id: Group-wise sampling from normal distribution

View source: R/rnorm.by.id.r

rnorm.by.idR Documentation

Group-wise sampling from normal distribution

Description

Populates 1 sample from normal distribution for each group (id or subject, or trial, or other)

Usage

rnorm.by.id(id, mean = 0, sd = 1)

Arguments

id

vector with group information

mean

mode of the normal distribution

sd

standard deviation of the normal distribution

Value

samples of a normal distribution, one for each level of group

See Also

sample.by.id

Examples

df = example.pkpdData()
sam = rnorm.by.id(df$id, mean = 0, sd = 1)
tapply(sam,df$id, unique)

qPharmetra/qpToolkit documentation built on May 24, 2023, 8:52 a.m.