Advanced Programming

For questions related to the advanced programming course
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
dxiao2017
Quartz | Level 8

There is a tiny mistake in the question (s106s02, part b), on page 314, the values in the CASE WHEN statement (see below) should also include No Change, besides Increasing, Decreasing, and Unknown, according to the answer code on page 319 (see below).

Untitled1.png

Untitled2.png

1 ACCEPTED SOLUTION

Accepted Solutions
CarleighJoC
SAS Employee

Great catch! After some investigation it seems like that may have been added in the case of EstYear1PCT being equal to EstYear3PCT. There was no change to the results when I deleted else "No change", but perhaps No change would appear for another value of the RegionValue macro variable- or it was just added as a "catch all". We will look into updating the instructions, thanks!

View solution in original post

2 REPLIES 2
CarleighJoC
SAS Employee

Great catch! After some investigation it seems like that may have been added in the case of EstYear1PCT being equal to EstYear3PCT. There was no change to the results when I deleted else "No change", but perhaps No change would appear for another value of the RegionValue macro variable- or it was just added as a "catch all". We will look into updating the instructions, thanks!

dxiao2017
Quartz | Level 8

Hi Carleigh, thanks a lot for your reply!

 

What I get from your reply is: for the selected value of &Regionvalue macro variable, there is no change between EstYear1PCT and EstYear3PCT; but for other possible values of &Regionvalue macro variable, maybe there is change from EstYear1PCT to EstYear3PCT, and this is the reason that "No Change" was not a value for the "Forecast" column in the question, but it appears in the answer code. Thanks a lot for your explain!

 

The reason I posted my thread is: while following the instruction in the question I was a bit confused (because I expected there was a chance of "no change" when comparing two numeric values, also I ignored the instruction that "Unknown" was for null values and did not know which column has missing values in the input dataset), and I wrote my answer like this (see below), I tried twice and did not get it right, then I scrolled to the answer code and see there is a "No Change" value for the Forecast column. I was going to explore the input dataset further but did not want to spend too much time on just one question, so I posted the problem here. Next time when practice this question I will explore the input dataset more. Thanks a lot for your attention and explanation! Best

proc sql;
select countrycode,indicatorname,
       estyear1/100 as estyear1pct format=percent7.2,
       estyear3/100 as estyear3pct format=percent7.2,
       case when calculated estyear3pct-calculated estyear1pct>0
               then 'Increasing'
            when calculated estyear3pct-calculated estyear1pct<0
               then 'decreasing'
            when calculated estyear3pct-calculated estyear1pct=0
               then 'Unknown'
       end as forecast
   from sq.globalfindex
   /*more statement*/;
quit;
proc sql;
select countrycode,indicatorname,
       estyear1/100 as estyear1pct format=percent7.2,
       estyear3/100 as estyear3pct format=percent7.2,
       case when calculated estyear3pct>calculated estyear1pct
               then 'Increasing'
            when calculated estyear3pct<calculated estyear1pct
               then 'decreasing'
            else 'Unknown'
       end as forecast
   from sq.globalfindex
   /*more statements*/;
quit;

sas-innovate-white.png

Join us for our biggest event of the year!

Four days of inspiring keynotes, product reveals, hands-on learning opportunities, deep-dive demos, and peer-led breakouts. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Autotuning Deep Learning Models Using SAS

Follow along as SAS’ Robert Blanchard explains three aspects of autotuning in a deep learning context: globalized search, localized search and an in parallel method using SAS.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1621 views
  • 1 like
  • 2 in conversation