Announcement

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

  • Multiplication errors using gen

    I'm using the code below to generate a new variable that is the unique id multiplies by 100. However, the result is not the correct value.

    Code:
    gen entryid=.
    format entryid %12.0g
    replace entryid=(ExternalReference * 100)
    For instance ExternalReference 1000863 does not end up as 100086300, but rather 100086304

    Does anyone know what could cause this?

    Chris

  • #2
    Duplicate thread. If interested please follow https://www.statalist.org/forums/for...rors-using-gen

    Comment

    Working...
    X