Learn R Programming

cwhmisc (version 4.0)

FinneyCorr: Finney's correction to log normally distributed data, r-squared and standard deviation of a linear model.

Description

FinneyCorr: Finney's correction factor K in $latex$ (see Note), to be used if $\ln x$ is normally distributed with standard deviation $latex$. FC.lm, R2.lm, s.lm: Finney's correction, $R^2$ and standard deviation extracted from an object of class "lm".

Usage

FinneyCorr(s,n)
  FC.lm(lmobj)
  R2.lm(lmobj)
  s.lm(lmobj)

Arguments

s
Standard deviation of log data, {$s_{\ln}$ in note.}
n
Number of data points.
lmobj
An object of class "lm".

References

Finney D.J., 1941. On the distribution of a variable whose logarithm is normally distributed. J. R. Stat. Soc., B 7: 155-161

Examples

Run this code
FinneyCorr(0.346274,24+3)  #  1.059306936

ok <- RNGkind()
RNGkind(kind = "default", normal.kind = "default")
set.seed(2009, kind = "default")
x <- rnorm(1000); y <- 0.1*rnorm(1000)
## Reset:
RNGkind(ok[1])

lmo <- lm(y ~ x)
FC.lm(lmo)  # 1.00472
R2.lm(lmo)  # 6.1926e-05
s.lm(lmo)   # 0.0970954

Run the code above in your browser using DataLab