BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
marieamure
Calcite | Level 5

I am using SAS under EG and I have a format problem with the mean procedure etc (descriptive statistics in french)...

It works fine with most of my variables but there is a problem with a variable in HHMM5. format (a time set in hours and minutes): the results are not in the same format, it uses what I think is the SAS format for date and time. When the mean should be something around 3:00 (3 hours)  the result is "11254.67". How can I translate it? The format is finely applied in the table but not in the MEAN report.

Thank you for you help or hints!

Marie

1 ACCEPTED SOLUTION

Accepted Solutions
TomKari
Onyx | Level 15

Hi, Marie

It looks to me like you're using your time variable as an "Analysis variable / VAR", not as a "Classification variable / CLASS" (I only have English  EG installed). If this is the case, I tried a couple of tests, and I agree with you that there doesn't seem to be a way to assign a format to the statistical results of PROC MEANS.

First of all, is that what you're actually trying to do? In other words, are you trying to obtain an "average time" from your task?

Second, are you getting displayed results from your task, or are you saving your statistics to a dataset. If you're saving to a dataset, it's easy to apply your format after your PROC MEANS run.

Lastly, I suggest sending your problem to SAS Technical Support. They are excellent at this kind of thing, and if there's a way to do it using the task in Enterprise Guide, they'll be able to tell you.

Tom

View solution in original post

4 REPLIES 4
TomKari
Onyx | Level 15

Hi, Marie

It looks to me like you're using your time variable as an "Analysis variable / VAR", not as a "Classification variable / CLASS" (I only have English  EG installed). If this is the case, I tried a couple of tests, and I agree with you that there doesn't seem to be a way to assign a format to the statistical results of PROC MEANS.

First of all, is that what you're actually trying to do? In other words, are you trying to obtain an "average time" from your task?

Second, are you getting displayed results from your task, or are you saving your statistics to a dataset. If you're saving to a dataset, it's easy to apply your format after your PROC MEANS run.

Lastly, I suggest sending your problem to SAS Technical Support. They are excellent at this kind of thing, and if there's a way to do it using the task in Enterprise Guide, they'll be able to tell you.

Tom

marieamure
Calcite | Level 5

Hello Tom,

Yes this is what I am trying to do, and that is obtaining an average time from the variable "time spent on site" in hours and minutes.

I was only displaying the statistical results in a report.

But now I have tried to save them in a dataset as you suggested, and the results for that variable appear in the right format HHMM5.

So thanks a lot!!

Marie

TomKari
Onyx | Level 15

I still suggest submitting the question to SAS Tech Support. If there's a way to format the result from PROC MEANS, I guarantee they'll find it.

One caution; make sure that your variable is a SAS TIME variable, not a DATETIME variable, or you'll get terrible results.

One trick I've used in the past on summarized results datasets is to process them with PROC TABULATE (the Summary Tables task). You can get very pleasing results this way.

Tom

art297
Opal | Level 21

I'm not sufficiently familiar with EG to give you direction on how to solve your problem, but it looks like you are trying to average a time variable, i.e., the number of seconds that the time represents.  11254.67/(60*60) would equal (approximately) 3 hours.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 746 views
  • 3 likes
  • 3 in conversation