Q. BY statement 사용과 관련하여 틀린 것은?
( FIRST. and LAST. are stored in the data set. )
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.
- The data sets. listed in the SET statement must be indexed or sorted by the values of the BY variable or variables.
- The DATA step automatically creates two variables, FIRST. and LAST. , for each variable in the BY statement.
- FIRST. and LAST. identify the first and last observation in each BY group respectively.
Q. Your data does not require any preprocessing if the observation in all of the data sets occur in which of the following patterns?
- Ascending or descending character order.
- Ascending of descending numeric order.
- The data must be groupped in some way.
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.
Q. Which temporary variables are available for DATA step programming during BY-group processing only, but are not added to data step?
( FIRST. and LAST. variable)
- In 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.
Q. Which program below creates the following output? - 데이터 sort 관련 -
proc sort data=cert.credit;
by type;
run;
[틀린 보기]
proc sort data=cert.credit;
by type ascending;
run;
- 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.
- 기본 오름차순 정렬이기 때문에 오름차순 정렬을 하고 싶다면 BY statement 에 순서를 지정하지 않아도 된다.
Q. What statement correctly describe a BY group? - BY GROUP -
- It includes all observations with the same BY value.
[틀린 보기]
- It contains temporary variables that SAS creates for each BY variable. ( X )
- it names a variable or variables by which the data set is sorted. ( X )
- It a method of processing observations from one or more SAS data sets that are group or ordered by one or more common variables. ( X )
- A BY group includes all observations with the same BY value.
- If you use more than one variabels in a BY statement, a BY Group is a group of observation with the same combination of values for these variables.
- Each BY Group has a unique combination of values for the variables.
Q. How dose SAS determine FIRST.variable? - FIRST.variable -
- 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 observation in the BY group, the value of FIRST.variable is 0.
SAS determins FIRST.variable by looking at each observation.
When observation is the first in a BY group, SAS sets the value of the FIRST.variablet 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.
Q. Which program creates the following output?
proc sort data=cert.choices out=work.choices;
by day flavor;
run;
proc print data=work.choices;
run;
'SAS > Chapter Review Quiz' 카테고리의 다른 글
| Chapter 2. Accessing Data (0) | 2023.01.03 |
|---|---|
| Chapter 1. SAS Programs (0) | 2023.01.03 |
| Chapter 13. Data Transformations (0) | 2023.01.03 |
| Chapter 15. Producing Descriptive Statistics (0) | 2022.12.22 |