Learn R Programming

invivoPKfit (version 2.0.1)

dlnorm_summary: Log-normal distribution density function for summary data

Description

Evaluates the normal distribution density function for summary data reported as sample mean, sample SD, and sample N. Sample mean and sample SD should be on the *natural* scale. If you have log-scale sample mean and SD (i.e., the mean and SD of log-transformed observations),then use [dnorm_summary()] instead.

Usage

dlnorm_summary(mu, sigma, x_mean, x_sd, x_N, log = FALSE)

Value

A numeric scalar or vector matching the length of the longest of `mu`, `sigma`, `x_mean`, `x_sd`, and `x_N`.

Arguments

mu

*Log-scale* mean of the log-normal distribution to be evaluated (*not* the sample mean). May be a numeric scalar or vector.

sigma

*Log-scale* standard deviation of the log-normal distribution to be evaluated (*not* the sample SD). May be a numeric scalar or vector.

x_mean

Sample mean (on the *natural* scale). May be a numeric scalar or vector.

x_sd

Sample standard deviation (on the *natural* scale). May be a numeric scalar or vector.

x_N

Sample number of observations. May be a numeric scalar or vector.

log

TRUE/FALSE: Whether to return the log of the density function (i.e., the log-likelihood). Default FALSE.

Author

Caroline Ring

Details

`x_mean`, `x_sd`, `X_N`, `mu`, and `sigma` should either be all the same size, or length 1. If they are different lengths, they will be repeated until their lengths match, with a warning.