全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1149 1
2016-12-18
Before the test I went over Question 70 and Question 50 only, I found around 1/3 of the questions are not familiar.

/*1. Modified from Question 35*/

DATA two;
   INPUT x y;
   DATALINES;
5  2
3  1
5  6
;run;
PROC PRINT; RUN;
  data ONE  TWO  OTHER;
     set TWO;
     if X eq 5 then output ONE;
     if Y lt 5 then output TWO;
     /*original was simply "OUTPUT;"*/
     else if output;
  run;
title'one';
proc print data=one;run;
   title'two';
  proc print data=two;run;
title 'other';
  proc print data=other;run;

/*Asking the number of observations in each data sets. I got it wrong, but I think the correct answer
is: two obs in dataset one; two obs in dataset two*/

/*2. Modified from Question 46*/

DATA one;
   /*one blank value for one more indicator Revenue2007*/
   INPUT Revenue2007 Revenue2008 Revenue2009 Revenue2010;
   DATALINES;
   
. 1.2 1.6 2.0
;
;run;
proc print;run;
data WORK.TWO;
     set WORK.ONE;
     Total=mean(of Rev:);
  run;
  proc print;run;
  
  /*The value of total should be 1.6*/
  
  
/*3. Another question asking to calculate the total of three quarter's values using arrays

keypoint: http://support.sas.com/kb/41/380.html

using * to refer to all elements in the array
   _sum_ = sum(of array_name
  • );  

      _avg_ = mean(of array_name
  • );  */
      
      /*4. Proc Means calculates the average of
      "all non-missing numeric"
      "all missing and non-missing numeric"
      "all non-missing numeric and numbers stored as characters"
      "all missing and non-missing numeric and numbers stored as characters"
      
      I chose the 1st one, hoping it's right

  • 二维码

    扫码加我 拉你入群

    请注明:姓名-公司-职位

    以便审核进群资格,未注明则拒绝

    全部回复
    2016-12-20 03:18:32
    赞赞人品!
    二维码

    扫码加我 拉你入群

    请注明:姓名-公司-职位

    以便审核进群资格,未注明则拒绝

    相关推荐
    栏目导航
    热门文章
    推荐文章

    说点什么

    分享

    扫码加好友,拉您进群
    各岗位、行业、专业交流群