Question: Using the built in sas data set sashelp.Baseball proc print data=sashelp.Baseball; run; 1. Baseball teams that are strong up the middle have good catchers (position

Using the built in sas data set sashelp.Baseball

proc print data=sashelp.Baseball;

run;

1. Baseball teams that are strong "up the middle" have good catchers (position = C), 2nd basemen (position = 2B), shortstops (position = SS), and center fielders (position = CF). Use the sashelp.baseball data set to determine which teams were strongest up the middle in 1986: (a) Write a PROC SQL query that will result in the teams' summed number of runs (nRuns) for all players in the "up the middle" positions. Have the result be reported with the teams listed from most summed number of runs to least. (b) Which teams have the most powerful outfields? Write a PROC SQL query that will result in the teams' summed number of HOME RUNS (nHome) for all players in the outfield positions (LF, CF, RF). Have the result be reported with the teams listed from most summed number of home runs to least. The CAREER statistics are given in the sashelp.baseball data set as 'CrAtBat', 'CrHits', 'CrHome', 'CrRuns', 'CrRbi', 'CrBB'. (c) Suppose an "all-time great" player has a least 12 years of experience ('YrMajor'), at least 2000 career hits ('CrHits'), at least 1000 career runs ('CrRuns'), and at least 1000 career runs batted in ('CrRbi'). Write a PROC SQL query to report those players in the sashelp.baseball data set who were all-time greats in 1986, that is, at the times these statistics were gathered. Report the players along with their teams and their career statistics. (d) Write a a PROC SQL query to calculate career batting average (hits divided by at-bats) for the players in the sashelp.baseball data set. Report the players along with their teams and their career batting averages, listed from highest career batting average to lowest. Format the career batting average so that exactly 3 decimal places are given in the output listing, and give the career batting average column a clear label.

[FOR FUN: Why is the player with the worst batting average of interest to the actor Wayne Knight?]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!