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

I am performing a t-test on two time intervals. The variables are formatted HHMM.
The output displays as the unformatted SAS time:

 

time Mean
No 14859.2 
Yes 28801.9

 

is there a way to get SAS to display the output in HHMM. format, so that the output would look like (and read as time, as in "4 hours and 7 minutes"):

 

time Mean
No 4:07 
Yes 8:00

 

I'd rather not have to redo it by hand every time if possible. I have tried the FORMAT option on t-test but it had no effect.

Thank you for any ideas.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@strufan wrote:
The time variables are formatted in the data step. The FORMAT statement in PROC TTEST has no effect, unfortunately.

Send output from Proc Ttest into dataset(s). Then use one of the report procedures, Proc Print, Report or Tabulate to display the result where you have more control.

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Assign the format in the data step before PROC TTEST. Or use a format statement in PROC TTEST (note: I have not tried this)

--
Paige Miller
strufan
Calcite | Level 5
The time variables are formatted in the data step. The FORMAT statement in PROC TTEST has no effect, unfortunately.
Reeza
Super User
I think you are stuck reformatting at the end or modifying the template but then it's modified for all t-tests.

ballardw
Super User

@strufan wrote:
The time variables are formatted in the data step. The FORMAT statement in PROC TTEST has no effect, unfortunately.

Send output from Proc Ttest into dataset(s). Then use one of the report procedures, Proc Print, Report or Tabulate to display the result where you have more control.

strufan
Calcite | Level 5

Thanks. I was hoping to avoid that, but it actually was not too difficult with ODS OUTPUT.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 5 replies
  • 580 views
  • 0 likes
  • 4 in conversation