Announcement

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

  • Creating a dummy variable with missing data

    Hi!
    I've got another odd problem. So I joined two datasets, one with less values, to another. Basically, I'm trying to link data from a parent to their child. While it's working for the most part, I can't seem to create a dummy variable that actually accepts the 100+ non-parent groups as valid missing data because the joinby command seemingly erased them. I thought that by joining the data, it would accept the rest of the data as part of the whole and join the child data to the parent data without deleting the rest.
    I then need to figure out how to use that to create a dummy variable which will have 100+ missing variables and the only way that comes to mind is by entering a numerical value for the missing values then coding the dummy variable around that.
    I'm using stata 14 and any help would be much appreciated.
    Last edited by Rin Kraft; 27 Jul 2018, 07:33.

  • #2
    I thought that by joining the data, it would accept the rest of the data as part of the whole and join the child data to the parent data without deleting the rest.
    You should read the output of help joinby and select the appropriate unmatched() option to obtain the results you want.

    Comment


    • #3
      Please post the two original datasets and the resulting dataset using the -dataex- command (see 12.2 in the FAQ https://www.statalist.org/forums/help#stata). Tell us what you were hoping to get with the joinby command and your exact joinby command (in a code block).
      Stata/MP 14.1 (64-bit x86-64)
      Revision 19 May 2016
      Win 8.1

      Comment


      • #4
        Originally posted by William Lisowski View Post

        You should read the output of help joinby and select the appropriate unmatched() option to obtain the results you want.
        Thank you! You are brilliant! That worked perfectly!

        Comment

        Working...
        X