Announcement

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

  • Combining datasets

    I have 2 datasets of numerical, continuous variables both ranging in values from 0 to 98 and each with over 20,000 observations. I wish to generate a new variable which is the total of variables 1 ?and 2 with 40,000 observations and with the same range of values. What code would be suitable

  • #2
    I'm not sure I understand your explanation of what you want, but check out -help append-.

    Comment


    • #3
      You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex.

      Try to give us a very small example of the two data sets and what you want in the end.

      If you want to add variable one from one data set to variable two from another, you'd normally want to merge the two data sets so you have the right observation on variable 1 aligned with the right observation on variable 2. But that would not result in N becoming the sum of the N's from the two original data sets. [It sounds like you want to add variable 1 and variable 2 and then to divide by 2 (to keep the range the same.)

      Comment


      • #4
        Phil: https://www.statalist.org/forums/for...ng-2-variables appears to be a continuation of this thread.

        Mark: Abandoning a thread and starting another without cross-reference leads to small confusion and wasted effort.

        Comment

        Working...
        X