BookmarkSubscribeRSS Feed
luvduvbunny
Calcite | Level 5

Hi!

I'm new to SAS and I would love some help! I'm supposed to do a T-test on two treatment groups and their VO2 level change. But before I can do the T-test, I need to find the difference between the columns VO2peak_BL and VO2peak_F and make a NEW column VO2peak_max. I have no clue how to do that (I can take the long way around it and download the data into excel, make the column, and re-upload it, but I want to do it all in SAS to practice). 

After the new column VO2peak_max is created, I can then move onto the t-test!

 

2 REPLIES 2
Reeza
Super User

Are you trying to do a paired t test? If so, you do not need to take the difference first.

https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=statug&docsetTarget=statu...

 

Otherwise here's a tutorial on creating new variables.

 

https://video.sas.com/detail/videos/sas-analytics-u/video/4573023399001/creating-a-new-column-in-sas?autoStart=true&page=1
data want; *want is name of output data set;
set have; *have is name of input data set;

diff = Variable1 - Variable2; *new variable DIFF is created;

run;

 


@luvduvbunny wrote:

Hi!

I'm new to SAS and I would love some help! I'm supposed to do a T-test on two treatment groups and their VO2 level change. But before I can do the T-test, I need to find the difference between the columns VO2peak_BL and VO2peak_F and make a NEW column VO2peak_max. I have no clue how to do that (I can take the long way around it and download the data into excel, make the column, and re-upload it, but I want to do it all in SAS to practice). 

After the new column VO2peak_max is created, I can then move onto the t-test!

 


 

luvduvbunny
Calcite | Level 5

Hi!

The primary purpose of the problem was to test for whether the different exercise plans had a different effect on the subjects. That is, is there a ‘difference of differences’ for VO2max between the HIIT and MIT groups. Therefore my test would need to be a two-sample t-test

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1104 views
  • 0 likes
  • 2 in conversation