Appending with Several Variables

Forums Tips and Tricks Appending with Several Variables

Viewing 0 reply threads
  • Author
    Posts
    • #291
      adminpaul
      Keymaster

      There are two ways Append can work with more than just two variables.
      You might want to append X3 to X2 to X1, creating a single variable three times as long as the original variables. That works as you’d expect it to:
      Choose all the variables to append (in order from top to bottom in your resulting variable) and select
      Manip > Append and Make Group Variable
      You’ll get one appended “Data” variable and a “Group” variable that names all the source variables.

      But what about appending entire datasets? Suppose we have data on, say, diet items from the Burger King menu (for example, in DASL search for Burger King items) and then we lay hands on comparable data from MacDonald’s. If the MacDonald’s variables are the same (e.g. Calories, Protein, etc in the same order) then select all the first dataset variables as Y (Option-click or hold down Option and drag if they are adjacent icons) and then the second dataset variables as X (Shift-click, or Shift-drag). Now, when you look in the Manip menu, the Append command will have changed to

      Manip > Parallel Append

      The resulting variables will take their names from the “Y” set. The Group variable now just holds “y” and “x” to label the two groups.
      And yes, you can even undo this Append. Choose all the appended variables you wish to split as Y and the group variable as X. The resulting split variables each get their own relation.
      If the Append command hasn’t changed to Parallel Append, then check that you have the same number of X and Y variables.

      One more thing: If the two datasets do not have variable icons arranged in the same order, there is no need to drag them around into the same order. Just click on the second (X) icons in the order that matches the icons in the Y set. DD notices in the order in which you select icons. When you drag across several icons (click to the left of the first and drag to the right), the selection order is left to right.

Viewing 0 reply threads
  • You must be logged in to reply to this topic.