logo

2012 Basketball Scoring Analysis

   

Added on  2023-02-01

5 Pages1590 Words81 Views
 | 
 | 
 | 
/*1. Begin your program with the required header, filename, and
libname statements. As always,
your program must include comments in the appropriate places. Use
filename statements to
define the paths to the two raw data files. The readonly option
does not apply to these two
filename statements. */
/*Create a library name as MyLib and import hiscores.sas7bdat
dataset */
libname MyLib '/folders/myfolders/Project-13-967790/';
data hiscores;
set MyLib.hiscores;
run;
/*2. For this assignment the output file must be created with the
pages in a landscape layout. The
date is to only be displayed on the final section of the output.
The SAS output portion of your
PDF file should start on page number 2. */
/*3. Create a user defined format that can be used to display the
score type in the downloaded data
set as shown in the Type column on the first page of the sample
output. (In the data, PT is an
abbreviation for Point and FT is short for Free Throw.) */
/*4. Use the tabulate procedure to produce the output shown in
the posted results based on the
hiscores data set. Use labels as needed. Apply your user defined
format to display the values of
score type shown in the Type column. */
proc format;
value $typefmt (multilabel) /*User defined format name as
"typefmt" that can be used to display the score type */
'2PT' = "Two-Point"
'3PT' = "Three-Point"
'FT' = "Free Throw";
run;
2012 Basketball Scoring Analysis_1

options orientation=landscape; /*Output page in a landscape
layout */
options nodate pageno=2 number; /*The SAS output portion of your
PDF file should start on page number 2. */
title1 '2012 Basketball Scoring Analysis';
title2 'Baskets Made by Class and Position';
proc tabulate data=hiscores;
class class position score_type;
var bpg;
table score_type = 'Type',
class='Class' * bpg = 'Baskets per Game' * (Mean Median)
position = 'Position' * bpg = 'Baskets per Game' * (Mean
Median);
format score_type $typefmt.;
run;
/*5. Write a data step similar to the one shown in the lectures
that converts the USPres.csv file to a
SAS dataset named USPres in the work library. This data step will
include infile, input, format,
and label statements. You will need to make certain decisions
about this data (such as column
widths and the presentation of dates) based on your observations.
You will need to use the
firstobs option for the infile statement to tell SAS to skip the
column titles that are in the raw
data. Unlike the data step option by the same name, this option
does not use parenthesis. The
dates must be presented in the WORDDATE format when the dataset
is viewed or printed. . It
is expected that you will get the error shown below but you
should not have any other errors or
warnings in your log.
a. The columns must be in the order shown in the printed output
without using any
statements in the print procedure to control the order.
b. Even though the current president is still serving, we want an
end of term date so we
can do some additional calculations. Add a line of code to this
data step that will set the
end of term date (Exited) to April 15, 2019 when the end of term
date is missing.
c. Create a new variable that contains the number of years each
president has been out of
2012 Basketball Scoring Analysis_2

End of preview

Want to access all the pages? Upload your documents or become a member.