Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SAS Code Programming - Thank you in advanced PART OF THE VOTING TEXT FILE : (Since I cannot attach all of the text file because

SAS Code Programming - Thank you in advanced

image text in transcribed

image text in transcribed

image text in transcribed

PART OF THE VOTING TEXT FILE : (Since I cannot attach all of the text file because it is too long)

County Pct_Voted MedianAge MeanSavings Pct_Poverty PopulationDensity Gender Floyd, IA 47.59 37.9 134049 12.7 33.8 F Yellowstone, MT 35.72 33.5 87121 12.6 44.8 M Harney, OR 28.86 35.7 89645 12.8 0.7 M Crook, WY 21.17 33.4 113381 10.3 1.9 M Morrow, OR 33.79 33.6 54786 7.3 4 M Sullivan, TN 36.74 36.9 65711 16.1 354.7 M Caroline, VA 48.63 33.2 62698 14.6 37.6 F Christian, IL 51.4 36.3 117869 11.1 48.7 F Chickasaw, IA 43.87 35.7 173639 9.4 26.4 F Jackson, IA 47.51 35 131448 13 31.6 F Kent, DE 38.17 31.1 120322 13 196.4 M Cass, MO 34.26 32.3 57171 9.2 96.4 M Rio Grande, CO 34 33.7 52253 23 11.7 M

PLEASE COMMENT SO I CAN GIVE YOU THE REST OF THE DATA FROM THE TEXT FILE IN THE COMMENT

PROBLEM 1 [5 pts] -to be answered by everyone Examine the two code segments and answer the following questions. Code-1 data cpu; infile "cpudat.csv" delimiter-", input time line step device; run: Code-2 proc import datafile-"cpudat2.txt" out-cpu_imp replace; delimiter DATAROW-1; getnames-YES runi Note: See link if you don't know what a file extension is: https://www.lifewire.com/what-is-afile-extension-2625879 1) The datafile name used in Code-1 is 2) The datafile name used in Code-2 is 3) SAS dataset name for Code-1 is 4) SAS dataset name for Code-2 is 5) The delimiter used in Code-1 is 6) The delimiter used in Code-2 is 7) The datafile extension of Code-1 is 8) The datafile extension of Code-2 is 9) Tue or False? "Code-1 uses import statement while Code-2 uses infile statement" 10) Tue or False? "Code-1 and Code-2 perform the same type of function-i.e. they both allow you to get the data written into SAS dataset" PROBLEM 2 [10 pts]-to be answered by everyone The file voting_1992.txt attached to this assignment provides data acquired from census records selected counties in the U.S. who voted in 1992 elections. The data show County Pct_Voted MedianAge MeanSavings Pct Poverty -Name of the county -Percentage of people voted -Median age of the voters in that county -Mean savings in U.S. Dollars in that county -Percentage of people living in poverty in that county PopulationDensity -Population density (Population divided by square miles) in that county Dominant gender of the people voted in that county In this exercise you are asked to get the data into a SAS dataset and perform basic exploratory analysis of the data to analyze the characteristics of people voted. a) Open the dataset and examine the data. Answer the following: 1. How many Observations are there? 2. How many fields are there? Which fields are numerical? Which fields are text? 3. 4. b) Write the SAS code to create the SAS dataset using either IMPORT or INFILE statement. If you are using INFILE statement, pay attention to the text fields while writing your code. c Run a PROC PRINT to print your dataset in SAS. Do a print screen, to copy and paste the first 5 observations of the output. What is the 5-point summary numbers for percentage of people voted and median age? The 5-point summary numbers are min, max, median or 50% percentile, Q1 and Q3. Include the output. Discuss your findings. d) e) Create a histogram to analyze the percent people voted. Include the histogram output. Using the histogram and the 5-point summary from the previous question, analyze the histogram. Discuss your findings. Also, is it normal, or skewed; do you see outliers? f Create a boxplot to analyze percentage of people voted by gender. Include the output. What can you say about the gender and voting patterns? Discuss your findings using the boxplot. g) What is the gender breakdown in this dataset? (Hint: use PROC FREQ)Include the output. Which is the predominant gender in this dataset? h) Copy and paste your FULL SAS code into the word document along with your answers. PROBLEM 1 [5 pts] -to be answered by everyone Examine the two code segments and answer the following questions. Code-1 data cpu; infile "cpudat.csv" delimiter-", input time line step device; run: Code-2 proc import datafile-"cpudat2.txt" out-cpu_imp replace; delimiter DATAROW-1; getnames-YES runi Note: See link if you don't know what a file extension is: https://www.lifewire.com/what-is-afile-extension-2625879 1) The datafile name used in Code-1 is 2) The datafile name used in Code-2 is 3) SAS dataset name for Code-1 is 4) SAS dataset name for Code-2 is 5) The delimiter used in Code-1 is 6) The delimiter used in Code-2 is 7) The datafile extension of Code-1 is 8) The datafile extension of Code-2 is 9) Tue or False? "Code-1 uses import statement while Code-2 uses infile statement" 10) Tue or False? "Code-1 and Code-2 perform the same type of function-i.e. they both allow you to get the data written into SAS dataset" PROBLEM 2 [10 pts]-to be answered by everyone The file voting_1992.txt attached to this assignment provides data acquired from census records selected counties in the U.S. who voted in 1992 elections. The data show County Pct_Voted MedianAge MeanSavings Pct Poverty -Name of the county -Percentage of people voted -Median age of the voters in that county -Mean savings in U.S. Dollars in that county -Percentage of people living in poverty in that county PopulationDensity -Population density (Population divided by square miles) in that county Dominant gender of the people voted in that county In this exercise you are asked to get the data into a SAS dataset and perform basic exploratory analysis of the data to analyze the characteristics of people voted. a) Open the dataset and examine the data. Answer the following: 1. How many Observations are there? 2. How many fields are there? Which fields are numerical? Which fields are text? 3. 4. b) Write the SAS code to create the SAS dataset using either IMPORT or INFILE statement. If you are using INFILE statement, pay attention to the text fields while writing your code. c Run a PROC PRINT to print your dataset in SAS. Do a print screen, to copy and paste the first 5 observations of the output. What is the 5-point summary numbers for percentage of people voted and median age? The 5-point summary numbers are min, max, median or 50% percentile, Q1 and Q3. Include the output. Discuss your findings. d) e) Create a histogram to analyze the percent people voted. Include the histogram output. Using the histogram and the 5-point summary from the previous question, analyze the histogram. Discuss your findings. Also, is it normal, or skewed; do you see outliers? f Create a boxplot to analyze percentage of people voted by gender. Include the output. What can you say about the gender and voting patterns? Discuss your findings using the boxplot. g) What is the gender breakdown in this dataset? (Hint: use PROC FREQ)Include the output. Which is the predominant gender in this dataset? h) Copy and paste your FULL SAS code into the word document along with your answers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions