100% Guaranteed Results


ST 555 – Programming HW #2 Solved
$ 20.99
Category:

Description

5/5 – (1 vote)

Directions:
In addition to the formatting described at the beginning of PROG HW #1, remember that the goal of these assignments is for you to write a single program that produces all of the desired results stated below. Just because one requirement comes before another one in the assignment doesn’t mean that’s the way you should write your program – it is up to you to figure out the most efficient way to write the program! If any of the directions are unclear don’t forget you can use the discussion board where you will likely get a quick clarification!

• Create a library named “HW2” that points to the same location you store any SAS files for this assignment.
• The non-SAS data set you use should be associated with fileref s “Pres1”.
• Read in the “Pres1” file using your filref. The variables in order are FullName, City, State, ASP, DOB, Term, Votes, PercVote. ASP means “age starting presidency” and PercVote is the “percent of the vote.” For this data set do the following:
1. Assign an appropriate format to DOB, votes, and PercVote
2. Assign appropriate labels to all variables.
3. Create a character variable (DOBC) that contains DOB in the form 01JAN1960.
4. Use the SUBSTR() function to create a new character variables to hold the day, month, and year from DOBC.
5. Create another character version of DOB and name it DOBC2, these dates should be in the form 01/31/1960.
6. Using the SCAN() function to create three numeric variables that hold the day, month, and year from DOBC2.
7. Include a comment in your code that explains (briefly!) the difference between SUBSTR() and SCAN().
8. Use the TRANWRD() function to change DOBC2 so that the dates are in the form 01-31-1960.
– The syntax is TRANWRD(’string’, ’target values’, ’replacement values’)
– E.g. TRANWRD(’Jonathan’, ’n’, ’N’) would yield the value ’JoNathaN’
• Create a report that does the following:
– Prints out the descriptor portion of the data set. Include page numbers, starting with page number 1 for each data set, but don’t include any dates.
– Second, computes the mean and median ASP and PERCVOTE grouped by STATE. – Third, computes the frequencies of presidents by STATE as well as by STATE and AGE – Last, prints the content portion of the data set.
– Each section of the report should start with page number 1 and not include any dates or times.

Reviews

There are no reviews yet.

Be the first to review “ST 555 – Programming HW #2 Solved”

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

Related products