Hi! With the help of @PGStats I have this code - which works great. I need to now add in one more dimension. I need to calculate the difference between Q1- Visit1 and Q2_Visit2, and THEN get the descriptive statistics of the change.
something like sum(Q1)[visit2] -sum(Q1)[visit 1] as change....then all the descriptives would use 'change' (instead of totalscore). I'm just not sure where to indicate the visit value. Help is appreciated!!
proc sql;
create table sep_004 as
select visit, mean (totalscore) as mean, max(totalscore) as max, min(totalscore) as min,
std(totalscore) as std, nmiss(totalscore) as nmiss, n(totalscore) as n, ('004') as Study
from
(select PID, visit, sum(Q1) as totalscore
from sep004
group by PID, visit)
group by visit;
select * from sep_004;
quit;
... View more