SAS Quiz 4- Chapter 13

5.0(1)
studied byStudied by 3 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/31

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 8:54 PM on 11/12/23
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

32 Terms

1
New cards

Array

A collection of elements (normally SAS variables) that allow you to write SAS statements referencing this group of variables

2
New cards

Array statement

Used to create the array

3
New cards

Array names follow the same rules you use for SAS Variables. True or False?

True

4
New cards

Describe the syntax of an Array statement

Following the keyword ARRAY is the name you chose for your array. Array names follow the same rules you use for SAS variables. Following the array name, place the number of elements in brackets. Lastly, list the variables you want to include in the array. May use SAS shorthand for referring to a list of variables here, such as Var1-Varn

5
New cards

You may use ( ) or ( ) following the array name to specify the number of elements in the array

You may use square brackets [ ] or parentheses ( ) following the array name to specify the number of elements in the array

6
New cards

By placing the array in a DO Loop you can

process each variable in the array

7
New cards

Since we do not need or want the DO loop counter included in the SAS data set, we can use the

DROP statement

8
New cards

SAS arrays must contain all ( ) or all ( ) variables

numeric or character variables

9
New cards

If the variables you want to include in a character array are already defined as character then you can ( )

If the variables you want to include in a character array are already defined as character (for example, they are coming from a SET statement), you can write an ARRAY statement resembling the one in the previous section.

10
New cards

If you do not know the amount of variables in an array you can use an

asterisk

11
New cards

The keyword _CHARACTER_ is used as

the variable list

12
New cards

Because the _CHARACTER_ follows the SET statement, it includes all

the character variables in the Chars data set

13
New cards

Describe how to convert all character values to Propercase

May use the keyword _CHARACTER_ to reference all the character variables in the data set and then use a DO loop to convert all the values to Propercase

14
New cards

You can include variables in an ARRAY statement that does not exist in your SAS data set, True or False?

True

15
New cards

When creating a new variable- If no variables are listed and the number of elements is specified, SAS creates….

If no variables are listed and the number of elements is specified, SAS creates variable names automatically given by the name of the array followed by 1 to n such that n is the length of the array

16
New cards

By default, SAS numbers the elements of an array starting from…

1

17
New cards

Describe how to specify the beginning and ending values of the array elements…

You can use the lower and upper bounds in the brackets. following the array name and separate them with a colon

array Income {2010:2017} Income2010-Income2017;

array Income Taxes {2010:2017} Taxes2010-Taxes2017;

18
New cards

True or False? You can create an array that only has elements and no variables!

True

19
New cards

Elements of temporary arrays are great places to….

store values or perform table lookups

20
New cards

When can you assign the array elements initial values…

You can assign the array elements initial values when you create the temporary array or you can load values into the temporary array in the DATA step

21
New cards

Values in the temporary array are automatically retained; True or False

True, they are not set to missing values when the DATA step iterates.

22
New cards

What tells SAS that an array is temporary

_TEMPORARY_ tells SAS that this is a temporary array and the values in parentheses are the initial values for each of the elements of this array

23
New cards

Its important to remember that in making a temporary array, there are no…

corresponding variables

24
New cards

We can also load values for a temporary array from a file… True or False?

True

25
New cards

When loading values for a temporary array from a raw data file, we would use the value of _N_ when…

We use the value of N, when we want to read the first line of the data file, differently from the other lines. _N_ can be used to ensure that the answer key values are read only once.

26
New cards

The value of _N_ counts the

Iterations of the DATA step

27
New cards

SAS arrays may be multidimensional, true or false?

True

28
New cards

Describe a multidimensional array

Instead of having a single index to reference an element, we have multiple indices

29
New cards

When we have two dimensions, we can think of them as….

row and column indices

30
New cards

Describe how to define a multidimensional array

Specify the number of elements in each dimension in the brackets, following the array name, separated by commas

31
New cards

How would we define an array called MULTI with 3 elements on the first dimension and five elements on the second dimension

array Multi {3, 5} X1-X15;

32
New cards

To determine the number of elements in an multidimensional array…

you multiply the number of elements in each dimension