BookmarkSubscribeRSS Feed

Prepare World Tourism Data: Programming 2 Case Study

Started ‎09-27-2018 by
Modified ‎09-27-2018 by
Views 6,846

How many times have you started working with data that is completely ready for analysis? Once, twice, always, NEVER? Well hopefully not never, but typically data is not ready for analysis and it can be your job to prepare it.

 

Now, you might hear all sorts of different statistics regarding data preparation, but the typical stat you will hear is the 80/20 rule. The rule states that 80% of your time will be spent preparing data and the other 20% will be spent on analysis. Some surveys even conclude that data preparation can be the least enjoyable part of the project, which is crazy! I see the data preparation stage as a puzzle that needs to be solved, and I love puzzles!

 

In this case study you will focus on preparing 2014 global tourism data using the knowledge gained from the SAS Programming 2 course. The current tourism data is not in a format ready for analysis, and to prepare the data correctly you will need to follow the requirements in the case study. Requirements include:

 

  • reorganizing the data
  • creating new columns
  • converting character columns to numeric
  • converting character case
  • dropping unnecessary columns
  • create and applying a custom format
  • merging data

Try to think of this problem as a puzzle that needs to be solved. Take your time, work on one part at a time and move on to the next!

 

When working on this case study you might be thinking "what do I do if I get stuck?" That's an excellent question! Let's discuss the ways you can attempt the case study to best suit your specific needs:

 

  1. If you feel comfortable with the topics in the SAS Programming 1 course and want to treat this as a real-world problem, read the Introduction, Data Layout and Requirements sections of the PDF and begin! During the process feel free to use your notes, Google, or SAS Documentation. When you are done look at the Data Validation section in the PDF to compare your results to the results provided.
  2. If you think you might need a bit of assistance in the case study use the Assignment Guide section to help guide you. The guide will not give you the solutions, but more of a road map on how to solve problem.
  3. If you are new to SAS and want to use the case study as more of a demo feel free to do so. You can use the Assignment Guide and Hints section to give you a suggested solution to each specific problem. I recommend after your run through the case study as a demo to go back and attempt it on your own.

If you have any questions regarding the case study, if you complete the case study and come up with different solutions and want to show them off, or if you want to post additional visualizations or analysis of the data create a post in the SAS Programming 1 and 2 ForumWe would love to hear from you! 

 

To attempt this case study, you will need to download the following:

  • SAS Programming 2 Data Manipulation Techniques Case Study PDF
  • cs_tourism.sas SAS program. Run the program and it will create the country_info and tourism tables necessary for the case study. Both these tables will be created in your WORK library.
  • log_scanner.sas SAS program. This program will be used in the case study bonus.

Be curious. What questions can you answer with your newly prepared data?  

Comments

LOVE the Log Scanner program!

I'm stuck on Question 5 of the Case Study. When I type in the if-then statement to change the .. to missing values, none of the values changes. My log gives me the all-clear. I filter my data before hand to check how many values need to be changed so that I know that some changes need to occur. I'm using SAS Studio so I'm not sure how I can show you my code.

@CalebSindi can you paste your code or save the SAS program and attach it? Can't determine the issue without see the code.

 

The solution is on 1-11 of the PDF as well.

Hi, @Panagiotis here's my code. I appreciate the help.

 

data cleaned_tourism;
length Country_Name $ 300;
length Tourism_Type $ 20;
retain Country_Name Tourism_Type ' ';
set tourism(drop=_1995--_2013);
if A not=. then Country_Name=Country;
if Country='Inbound tourism' then Tourism_Type=Country;
if Country='Outbound tourism' then Tourism_Type=Country;
if Country_Name ne Country and Tourism_Type ne Country then output;
Series=upcase(Series);
if Series=".." then Series=" ";
ConversionType=strip(scan(Country,-1,' '));
run;
Version history
Last update:
‎09-27-2018 03:10 PM
Updated by:

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Article Labels
Article Tags