Chapter 8: BY-Group Processing

  1. Correct answer: d
    When you use the BY statement with the SET statement, the DATA step creates the temporary variables FIRST. and LAST. They are not stored in the data set.
  2. Correct answer: d
    Before you can perform BY-group processing, your data must follow a pattern. If your data is not ordered or grouped in some pattern, BY-group processing results in an error.
  3. Correct answer: a
    In the DATA step, during BY-group processing only, the temporary variables FIRST.variable and LAST.variable are available for DATA step programming, but they do not appear in the output data set.
  4. Correct answer: c
    The SORT procedure sorts the data Cert.Credit by the variable Type in ascending order. You do not have to specify the order in the BY statement in PROC SORT unless you are sorting in DESCENDING order.
  5. Correct answer: b
    A BY group includes all observations with the same BY value. If you use more than one variable in a BY statement, a BY group is a group of observations with the same combination of values for these variables. Each BY group has a unique combination of values for the variables.
  6. Correct answer: c
    SAS determines FIRST.variable by looking at each observation. When an observation is the first in a BY group, SAS sets the value of the FIRST.variable to 1. This happens when the value of the variable changed from the previous observation. For all other observations in the BY group, the value of FIRST.variable is 0.
  7. Correct answer: a
    The SORT procedure sorts the data Cert.Choices by the variable Day first, then Flavor in ascending order, and finally output the sorted data set to Work.Choices.
Last updated: August 23, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.186.83