BookmarkSubscribeRSS Feed
Asger
Fluorite | Level 6

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

3 REPLIES 3
andreas_lds
Jade | Level 19

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.

Asger
Fluorite | Level 6

 

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?

Tom
Super User Tom
Super User

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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1151 views
  • 0 likes
  • 3 in conversation