Hi.
In my data file I have a variable containing time consumption (hours:minutes; not a time of day). It is saved in the "time"-format. Using the Summary Statistics Wizard in SAS Enterprise Guide I end up with integers and not the original format of time.
How can I change this so I end up with a summary statistics of time?
See attached file.
All the best,
Asger
The time-format in sas is always the number of seconds since midnight. Please post your data using a data-step with datalines statement, office-files aren't helpful to show data.
Thank you for the response. My input is hours and minutes between to dates and times; it is not a time of day. So I don´t think the number of seconds since midnight can be used here.
This is the autogenerated code from Enterprise Guide:
PROC MEANS DATA=WORK.SORTTempTableSorted
FW=12
PRINTALLTYPES
CHARTYPE
QMETHOD=OS
MIN
MAX
N
Q1
MEDIAN
Q3 ;
VAR "Tid diff1"n;
RUN;
Was that what you were looking for Andreas?
Means will not try to use formats in that simple display. If you want to attach a format then write your statistics to a dataset and print that.
Then you can attach formats to the values.
data x ;
input y time5. ;
format y time5. ;
cards;
10:30
11:30
;
proc summary ;
var y;
output out=want mean=mean_y min=min_y max=max_y ;
run;
proc print data=want;
var m:;
format m: hhmm. ;
run;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.