Assignment 1 instructions

docx

School

Florida State University *

*We aren’t endorsed by this school

Course

STA 3024

Subject

Statistics

Date

Feb 20, 2024

Type

docx

Pages

2

Uploaded by jasenrinehart

Report
STA 3024 Assignment 1 Put question numbers and letters in your program as comments. Select the contents of your program and press CTRL + c to copy. Paste your corrected SAS program into a single .txt or .docx file and submit through Canvas. You do not have to submit any SAS output. All data sets are in /courses/d649d56dba27fe300/STA3024 in SAS Studio. Use this location in all INFILE statements. 1. (34 points total) The following key provides variable names, types, and the corresponding column numbers for the values in the data file called Textbooks.txt: Variable Type Columns Departmen t Character 1-4 Course Character 5-8 ISBN Character 9-22 Bookstore Numeric 23-28 Amazon Numeric 29-34 Required Character 35 a. (12 points) Create a data step in SAS to read all of the data using the column style of input. Print the entire results. b. (12 points) Use the formatted style of input (making use of the “@” symbol) by reading only the following five variables in the order specified: Department first, Course second, Required third, Amazon fourth, and ISBN fifth. Do not read the remaining variable. Print the first 5 observations. c. (10 points) Modify the Print procedure in (b) to label Required as “Required for the course?” and Amazon as “Price on Amazon.com”. Print all observations but only the variables ISBN. Amazon, and Required, in that order. 2. (38 points total) The data set found in the file EduTrends.txt contains the following variables (in the order given): Variable names: Year Enroll Unemp HSgrad Income a. (12 points) Read the data using the list style of input where the asterisks (*) serve as delimiters. Print the results. b. (6 points) Repeat Part (a); however, this time add the “missover” option. Print the results. c. (6 points) Repeat Part (a); however, this time use “DSD” option. Print the results. d. (6 points) Indicate which approach (a, b, or c) was the correct approach and explain why. Give your answer as a comment in your program.
e. (8 points) Using the correct approach above, re-label the variable names Enroll as “Enrollment”, Unemp as “Unemployment Rate”, and HSgrads as “Number of High School Graduates”. Print the first 4 observations of the resulting SAS data set. 3. (28 points total) The data on cost of living indices for a sample of world cities (New York = 100) is contained in the file, CityCosts.txt. It includes the following variables: City, Country, CostLiving (cost of living index), Rent (rent index), Groceries (grocery cost index), Restaurant (restaurant cost index) and PurchasePower (purchasing power index). Complete the following: a. (12 points) Read the data set into SAS using the list style of input such that the full city and country names can be displayed. Print the first 15 observations of the resulting data set. b. (8 points) Create a new data step based on a modification of the one used in (a) above. It should read the data as before but also include calculations. The first calculation should create a new variable called AverageCost which is the average of the values of Rent, Groceries, Restaurant, and PurchasePower. Create a second variable called Diff which is the difference between AverageCost and CostLiving (AverageCost - CostLiving ). Print just the variables AverageCost, CostLiving, and Diff for the first 12 observations of the resulting data set. c. (8 points) Again, create a new data step based on a modification of the one used in (a) above. Include one calculation to create a new variable called WCost which is the weighted average (65%/35%) of the values of Groceries and Restaurant (i.e., 0.65* Groceries + 0.35* Restaurant ). Create a second variable called Diff2 which is the difference between WCost and CostLiving (WCost - CostLiving ). Print just the variables WCost, CostLiving, and Diff2 for the first 12 observations of the resulting data set.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help