Announcement

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

  • Reshape Long from Wide - type mismatch with other ...variables

    Hello!

    I´m trying to reshape a database to long from wide, but the follow message occurs in STATA/SE12.0:

    "...cotfech10 type mismatch with other cotfech variables."

    The cotfechvariable10 is a variable with all values missing.

    I have four variables (cotfech, cotvwap, difsald and difret), and some are missing values and others don´t.

    These four variables were observed for 25 periods (cotfech1, cotfech2....cotvwap1, cotvwap2....difsald1, difsald2,...difret1, difret2...)

    Someone can help me?

    Attached Files

  • #2
    It seems one of - coeftech - variables has a different type. Just type : describe cotfech* - and compare variables. If they are different, please type - help recast - for that matter.
    Best regards,

    Marcos

    Comment


    • #3
      With regard to attached files, please read the FAQ.
      Best regards,

      Marcos

      Comment


      • #4
        Hi Marco, thanks for your help.

        I discovered that the cotfech10 variable, and others with "." in the collumn, are assumed to be a "strl" type storage, with the command describe.

        I tried the command recast to change them (string variables), alone and with force ("recast force variable type") for double, as the others variables (even that this make the variable missing, that what I want), however it doesn´t work.

        When I try this, the follow message appears:

        "cotfecha10: double invalid" or with force "double not allowed.

        I even try change to others types of variable, as int for example, but I´ve got the same message.

        Do you know how can I fix this, to be able to reshape the database?

        Best regards, Marcel.

        Comment


        • #5
          If you only have numerical values plus “.”, try - destring - command.
          Best regards,

          Marcos

          Comment


          • #6
            Hi Marco, just feedbacking you.

            I saw others adivces and drop the entires colummns with only ".".

            With this I can reshape the database.

            Thanks for your help.

            Best regards, Marcel.

            Comment

            Working...
            X