Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Log of number to specific base

    Hello,

    I have a number
    0.06897

    I'm looking for its log to the base 15

    In Excel for example I would enter the formula =log(0.06897,15) to return -0.9875

    How can I do this in Stata please, cant find anything online.

    Thanks

  • #2
    Solved it...

    gen log_probability = ln(var)/ln(15)

    Comment


    • #3
      In Stata only natural logarithms and logarithms base 10 are specifically supported, presumably on the grounds that using any other base implies only a scaling factor.


      Code:
      . di log10(225)/log10(15)
      2
      
      . di ln(225)/ln(15)
      2
      
      . di ln(0.06897) / ln(15)
      -.98745719

      Comment


      • #4
        Code:
        . local x=log(0.06897)/log(15)
        . di "`x'"
        -.987457193537458
        See, for example https://www.khanacademy.org/math/alg...ase-rule-intro

        Comment


        • #5
          Thanks, good information.

          Comment

          Working...
          X