Desktop productivity for business analysts and programmers

Format for MEAN under SEG

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Format for MEAN under SEG

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


Accepted Solutions
Solution
‎10-24-2012 11:36 AM
PROC Star
Posts: 1,146

Re: Format for MEAN under SEG

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


All Replies
Solution
‎10-24-2012 11:36 AM
PROC Star
Posts: 1,146

Re: Format for MEAN under SEG

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

New Contributor
Posts: 3

Re: Format for MEAN under SEG

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

PROC Star
Posts: 1,146

Re: Format for MEAN under SEG

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

PROC Star
Posts: 7,431

Re: Format for MEAN under SEG

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.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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