Announcement

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

  • weird values of destringed variable

    Dear all,

    I have a string variable with values such as 64.548394768763261

    I have used

    Code:
    encode var, generate(newvar)
    to destring the variable.

    When I now take the mean of it I am getting values that are much higher than the actual mean should be, such as 1648.63657173...

    That seems really odd to me and I suppose that I don't read the initial values of the variable as it is. Is there a way to solve this such that I get actual decimals. I hope my issue is comprehensible.

    Best,
    Julian

  • #2
    As the help for encode warns:

    Do not use encode if varname contains numbers that merely happen to be stored as strings; instead, use generate newvar = real(varname) or destring; see real() or [D] destring.

    Comment


    • #3
      Thank you, this solves it! :D

      Comment

      Working...
      X