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