I am using the SAShelp cars data set here. I know format (format=8.0) could be used to round to the nearest whole number, but I would like to round to a multiple. Is this possible with Proc Report?
This is what I have:
DATA MSRP_cars_rounded;
SET sashelp.cars;
Count = 1;
RUN;
PROC REPORT DATA = MSRP_cars_rounded;
COLUMN Origin DriveTrain Count ('MSRP' MSRP=MSRP_Med MSRP=MSRP_Q1 MSRP=MSRP_Q3);
DEFINE Origin / group;
DEFINE DriveTrain / group;
DEFINE MSRP_Med / analysis median 'Median';
DEFINE MSRP_Q1 / analysis Q1 'Q1';
DEFINE MSRP_Q3 / analysis Q3 'Q3';
RUN;
MSRP
Origin
DriveTrain
Count
Median
Q1
Q3
Asia
All
34
$26,898
$21,087
$32,445
Front
99
$19,560
$15,030
$25,920
Rear
25
$31,045
$25,700
$41,010
Europe
All
36
$39,445
$34,813
$49,390
Front
37
$34,845
$23,955
$40,565
Rear
50
$52,243
$39,995
$74,320
USA
All
22
$32,448
$25,520
$41,465
Front
90
$23,115
$18,995
$28,790
Rear
35
$30,835
$22,010
$41,815
This is what I want:
Count rounded to multiple of 5
MSRP rounded to multiple of 100 if the value is $20,000 or greater. Otherwise, rounded to a multiple of 50 if the value is less than $20,000.
MSRP
Origin
DriveTrain
Count
Median
Q1
Q3
Asia
All
35
$26,900
$21,100
$32,400
Front
100
$19,550
$15,050
$25,900
Rear
25
$31,000
$25,700
$41,000
Europe
All
35
$39,400
$34,800
$49,400
Front
35
$34,800
$24,000
$40,600
Rear
50
$52,200
$40,000
$74,300
USA
All
20
$32,400
$25,500
$41,500
Front
90
$23,100
$19,000
$28,800
Rear
35
$30,800
$22,000
$41,800
Thanks,
... View more