Question
MUST BE DONE IN SAS STUDIO You have decided that you need to brush up on your script development skills, so you have pulled the
MUST BE DONE IN SAS STUDIO You have decided that you need to brush up on your script development skills, so you have pulled the following information from Wikipedia to use as a sample data to show president and number of days in office from each state. Your analytics will help news channel to the presidential election pattern. In this assignment, you will analyze USPresident_Wikipedia_URLs_Thmbs_HW.csv file which can be found in the Course Materials folder. Your script should use a conditional statement and print only presidents who are from Ohio. You will then calculate a total number of days for each president from Ohio based on Took office and left office columns.
This is what i have so far
data presidentialanalysis; INFILE "/home/u63014964/presidentialanalysis/USPresidents.csv" dsd firstobs=2 truncover dlm =',' ; INPUT presidentNu presidentNa $ tookoffice $ leftoffice $ party $ Homestate $ ; informat tookoffice yyddmm10. leftoffice yyddmm10.; format tookoffice yymmdd10.; format leftoffice yymmdd10.; RUN; DATA NEW; SET PRESIDENTIALANALYSIS; IF Homestate ='Ohio'; daysserved = intck("days",tookoffice,leftoffice); proc print; RUN;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started