BookmarkSubscribeRSS Feed
Mmignon
Fluorite | Level 6

Hello fellow SAS-users

I'm working on a research project, where I have to compare if there is any significant change in variables on 5 different times (TIME 1-5) in 2 randomisation groups (Randomisation_code 0 and 1) (see dataset). I need to compare them as change from time 1 to 2, 2 to 3 etc. but also over the time at last.
Variables are defined as continuous and categorical (i.e. A1=continuous, A1_pathological = categorical).
I have, so far, just made counting of variables with 'proc freq' and stratified by randomisation_code, and in addition made testing by chisq.


I am very (as very much!) new to SAS and I do not know how to move forward and manage this problem. 
I will appreciate any help and step-by-step explanation.

Thanks in advance!
Sincerely
Mignon

 

4 REPLIES 4
Reeza
Super User
Its not clear what you need help with here. It would help to not provide excel file, but provide sample data directly in the post and show an example of what you want in the output. Many places do not allow users to download XLSX files to the system.
Mmignon
Fluorite | Level 6

Hi Reeza

Thank you for fast reply!

I do not know how to explain my problem, but I'll try with an example:

 

1) I need to see if there is change in variable 'A1_patological' from 'time 1' to 'time 2' to 'time 3' to 'time 4' to 'time 5' in total and afterwards stratified by randomisation code (0 or 1).

My participants does not necessary have measured A1 at all 5 time points.

 


2) as above, just to see if variable 'A1' (continuous value) is changing (raising or falling) at this 5 time points in total and afterwards stratified by randomisation code (0 or 1).

I suppose that I can present data as a diagram. 

 

I hope the data set is visible now with a copy and paste from Excel-file. Wasn't it that I should do?

Sincerely

Mignon

 

 

 

 

ParticipantID_and_timeRandomisation_codeP_pr_minA1A1_patologicalA2A2_patologicalA3A3_patologicalA4A4_patologicalA5A5_patologicalA_max_durA_max_dur_patologicalTIME
ID1time1073-0,251-0,251-3,25100008011
ID1time2077-0,251-0,51-41000010012
ID1time3088-0,251-0,2510000-0,2514013
ID1time40144-0,51-0,251-2,5100-0,2516014
ID1time5096-0,5100-2100-0,2516015
ID2time109300-0,5128205130-0,7692307691-13,8461538510061,5384615411
ID2time2081000000-7,4358974361-0,7692307691102,564102612
ID3time1079-0,51-0,2510000-0,2518011
ID3time205400-0,251-1,251-31008012
ID3time50670000-11-2,51002005
ID4time11114..........3011
ID4time419100-0,751-1,251-71004014
ID4time518200-1,251-4100004015
ID5time1085-0,51-0,51-0,25100-0,518011
ID5time205900-11-1100008012
ID5time308900-11-0,5100006013
ID5time4010400-1,25100-7,51006014
Reeza
Super User

1. Switch your data to a long format, it's easier to program your logic that way -> PROC TRANSPOSE or a DATA STEP. 

https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/

https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/

 

2. Use LAG to find the difference between the time points

http://support.sas.com/resources/papers/proceedings09/055-2009.pdf

3. Once you have that, you have the data to do your tests, which I think I answered in another post - you can use PROC MEANS to calculate the total change, or you can use PROC NPAR1WAY to test the values. 

 

 

Mmignon
Fluorite | Level 6

Thank you Reeza

I'll try work on it!

Sincerely
Mignon

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1082 views
  • 2 likes
  • 2 in conversation