* katemcguckin40@gmail.com;
Hi. I have 60 patients with varying number of patient visits for treatment.
The variable definitions are listed below.
This is a repeated measures study in which there are 1666 observations among the 60 patients.
I also printed out just the first 6 patient data to keep it short.
My name is Kate. I am new to longitudinal analyses.
I hope someone can help me.
* variables:
id = subject id
dob=date of birth
q_visitdate = visit date for therapy
visits = visit number
diff_bg= difference between pre and post-treatment blood sugar
q_pre_gluc = sugar level before treatment
q_post_gluc = sugar level after treatment
q_oxytime = time they spent in the treatment
q_oxyconcent = oxygen concentration for each treatment
visits= visit number
What do I need to calculate?
1. Using the structure I have, I want to just get the mean of each person (id's)
(1) diff_bg (difference between pre- and post-treatment dugar levels) ,
(2) pre-gluc (pretreatment sugar level)
(3) post_gluc (post-treatment sugar level,
(4) q_oxytime
So if I went through 20 treatments, I want the mean of those 4 variables in (1). I tried the lag
function,and it did not work.
The attachment did not go through (don't know why) but I copied several IDs with their values.
I apologize for the variables not being in straight columns.
What kind of attachments am I allowed? I tried .doc .lst
Kate 🙂
Duplicate of https://communities.sas.com/t5/Base-SAS-Programming/Longitudinal-data-programming/m-p/478546
Flagged as spam to remove duplicates.
Thank you. I figured it out and went to Cody's website and used his code!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.