SAS Base (46)

Given the SAS data set WORK.ONE:

Obs Revenue2008 Revenue2009 Revenue2010
1 1.2 1.6 2

The following SAS program is submitted:

data WORK.TWO;
set WORK.ONE;
Total=mean(of Rev:);
run;

What value will SAS assign to Total?

A. 3
B. 1.6
C. 4.8
D. The program fails to execute due to errors.

Check Answer
Answer: B

注解:本题使用了Variable List,Rev:是指选取所有以Rev开头的变量,并且在对变量列使用function时,要在变量列之前加上OF。mean(of Rev:)等价于 mean(Revenue2008, Revenue2009, Revenue2010),MEAN function用于求这三个值的均值。

Leave a Reply

Your email address will not be published. Required fields are marked *