Search Header Logo

SAS Chapter 15 Review

Authored by Zain Malik

10th - 12th Grade

Used 20+ times

SAS Chapter 15 Review
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Within the data set furn.bookcase, the variable Finish contains values such as ash, cherry, teak, and matte-black. Which of the following creates a subset of the data in which the values of Finish contain the string walnut? Make the search for the string case-insensitive.

data work.bookcase;

set furn.bookcase;

if find(finish,'walnut',I);

run;

data work.bookcase;

set furn.bookcase;

if find(finish,'walnut','I')>0;

run;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function correctly calculates the average of the variables Var1, Var2, Var3, and Var4?

mean(of var1-var4)

mean(of var1, var4)

mean (var1-var4)

mean(var1, var4)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Due to growth within the 919 area code, the telephone exchange 555 is being reassigned to the 920 area code. The data set Clients.Piedmont includes the variable Phone, which contains telephone numbers in the form 919-555-1234. Which of the following programs will correctly change the values of Phone?

data work.piedmont(drop=areacode exchange);

set clients.piedmont;

Areacode=substr(phone,1,3);

Exchange=substr(phone,5,3);

if areacode='919' and exchange='555'

then substr(phone,1,3)='920';

run;

data work.piedmont(drop=areacode exchange);

set clients.piedmont;

Areacode=substr(phone,1,3);

Exchange=substr(phone,5,3);

if areacode='919' and exchange='555'

then phone=substr('920',1,3);

run;

data work.piedmont(drop=areacode exchange);

set clients.piedmont;

Areacode=substr(phone,1,3);

Exchange=substr(phone,5,3);

if areacode='919' and exchange='555'

then phone=scan('920',1,3);

run;

data work.piedmont(drop=areacode exchange);

set clients.piedmont;

Areacode=substr(phone,1,3);

Exchange=substr(phone,5,3);

if areacode='919' and exchange='555'

then scan(phone,1,3)='920';

run;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The variable IDCode contains values such as 123FA and 321MB. The fourth character identifies the gender. How do you assign these character codes to a new variable named Gender?

Gender=substr(idcode,4);

Gender =substr(idcode,4,1);

Gender =scan(idcode,4,1);

Gender =scan(idcode,4);

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A typical value for the numeric variable SiteNum is 12.3. Which statement correctly converts the values of SiteNum to character values when creating the variable Location?

Location=dept || '/' || put(sitenum,4.);

Location=dept || '/' || put(sitenum,3.);

Location=dept || '/' || input(sitenum,4.);

Location=dept || '/' || input(sitenum,3.);

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The variable Address2 contains values such as Piscataway, NJ. How do you assign the two-letter state abbreviations to a new variable named State?

State=substr(address2,2);

State=substr(address2,13,2);

State=scan(address2,13,2);

State=scan(address2,2);

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Within the data set Hrd.Temp, PayRate is a character variable and Hours is a numeric variable. What happens when the following program is run?

data work.temp;

set hrd.temp;

Salary=payrate*hours;

run;

SAS converts the values of Hours to character values. A message is written to the log.

SAS converts the values of Hours to character values. No message is written to the log

SAS converts the values of PayRate to numeric values. No message is written to the log.

SAS converts the values of PayRate to numeric values. A message is written to the log.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?