Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please Complete SAS Programming 2 4 . Generating an Accumulating Column within Groups The pg 2 . np _ yearlyTraffic table contains annual traffic counts
Please Complete SAS Programming
Generating an Accumulating Column within Groups
The pgnpyearlyTraffic table contains annual traffic counts at locations in national parks.
Park names are grouped into park types.
a Open the ppsas program in the practices folder. Complete the PROC SORT step to
sort the pgnpyearlyTraffic table by ParkType and ParkName.
b Modify the DATA step as follows:
Read the sorted table created in PROC SORT.
Add a BY statement to group the data by ParkType.
Create a column, TypeCount, that is the running total of Count within each value of
ParkType.
Format TypeCount so that values are displayed with commas.
Keep only the ParkType and TypeCount columns.
c Run the program and confirm that TypeCount is reset at the beginning of each
ParkType
group.
d Modify the program to write only the last row for each ParkType to the output table.
proc sort datapgnpyearlyTraffic
outsortedTraffickeepParkType ParkName
Location Count;
Insert BY statement;
run;
data TypeTraffic;
set ;
run;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started