user2928318
user2928318

Reputation: 549

geometric standard deviation for a log normal distribution

I am trying to calculate geometric standard deviation of each log normal distribution. In the below,for example, I have x data in first row, wich is bin size (from 10 to 1000), and corresponding five y data in the next rows.

    10  10.9854 12.0679 13.2571 14.5635 15.9986 17.5751 19.307  21.2095 23.2995 25.5955 28.1177 30.8884 33.9322 37.2759 40.9492 44.9843 49.4171 54.2868 59.6362 65.5129 71.9686 79.0604 86.8511 95.4095 104.811 115.14  126.486 138.95  152.642 167.683 184.207 202.359 222.3   244.205 268.27  294.705 323.746 355.648 390.694 429.193 471.487 517.947 568.987 625.055 686.649 754.312 828.643 910.298 1000
    0.0170496   0.0239502   0.0332355   0.0455609   0.0616994   0.0825406   0.109082    0.142408    0.18366 0.233988    0.294489    0.366137    0.449692    0.545614    0.653963    0.774317    0.905696    1.04651 1.19455 1.34698 1.50043 1.65109 1.79482 1.92739 2.04464 2.1427  2.21822 2.26854 2.29184 2.28729 2.25505 2.19628 2.11309 2.00838 1.8857  1.74903 1.60258 1.45057 1.29705 1.1457  0.999738    0.861783    0.733851    0.617327    0.513004    0.421137    0.341527    0.273605    0.216532    0.169284
    0.564795    0.577687    0.5902  0.602296    0.61394 0.625095    0.635728    0.645804    0.655292    0.664162    0.672384    0.679932    0.686781    0.692908    0.698293    0.702918    0.706767    0.709826    0.712086    0.713539    0.71418 0.714007    0.71302 0.711223    0.708621    0.705224    0.701043    0.696093    0.69039 0.683953    0.676803    0.668965    0.660464    0.651327    0.641585    0.631268    0.620408    0.609041    0.5972  0.584922    0.572243    0.559201    0.545833    0.532178    0.518272    0.504155    0.489863    0.475433    0.460903    0.446307
    1.88874 1.99575 2.1007  2.20265 2.30064 2.39374 2.48101 2.56155 2.63452 2.69913 2.75466 2.80051 2.83615 2.86117 2.87529 2.87836 2.87032 2.85127 2.82144 2.78116 2.7309  2.67121 2.60276 2.52629 2.44262 2.35262 2.2572  2.15731 2.0539  1.94791 1.84027 1.73188 1.62359 1.51621 1.41048 1.30706 1.20656 1.1095  1.01631 0.927365    0.842942    0.763252    0.688433    0.618555    0.553629    0.493609    0.4384  0.387865    0.341834    0.300104
    0.190679    0.206669    0.223365    0.240726    0.258699    0.277225    0.296235    0.315651    0.335385    0.355342    0.375418    0.395503    0.41548 0.435228    0.454622    0.473532    0.491829    0.509384    0.526069    0.541758    0.556333    0.569679    0.58169 0.592269    0.60133 0.608797    0.614608    0.618714    0.62108 0.621687    0.620529    0.617615    0.612971    0.606636    0.598663    0.589119    0.578082    0.565642    0.5519  0.536964    0.52095 0.503979    0.486178    0.467675    0.4486  0.429082    0.409249    0.389225    0.36913 0.34908
    1.63196 1.69464 1.75432 1.81053 1.8628  1.9107  1.95381 1.99177 2.02423 2.0509  2.07155 2.08598 2.09406 2.09572 2.09094 2.07977 2.06231 2.03872 2.00922 1.97406 1.93356 1.88808 1.83801 1.78377 1.72583 1.66463 1.60068 1.53447 1.46647 1.39719 1.32709 1.25664 1.18628 1.11642 1.04745 0.979718    0.913557    0.849249    0.787045    0.727157    0.669765    0.615008    0.562995    0.513798    0.467461    0.423997    0.383394    0.345615    0.310603    0.27828

So, I have five log normal distributions. (Actually, I have hundreds log normal distributions to be calculated.) Then, I want to calculate each geometric standard deviation, which does not seem to be implemented in r packages. R package ("psych") provides a tool to calculate geometric standard deviation, but not for such data I have..

Instead, it can be calculated following the equation below,

http://www.eng.utoledo.edu/~akumar/IAP1/lung/calculateDiameter.htm

But, I have no idea how to calculate using such equation in r. Hope someone help me to calculate a geometric standard deviation of each log normal distribution either using r package or calculating the equation. Thanks a lot for your help, in advance.

S

Upvotes: 0

Views: 2288

Answers (1)

javivr
javivr

Reputation: 89

The easiest way is probably using:

exp(sd(log(x)))

Upvotes: 1

Related Questions