can you tell me why this isnt working tho. im just trying to try more things with it. im trying to find the mean and standard deviation of each period, subtract the means from each other and find the mean of that difference then subratct the standard deviations from each other. tried to google. thanks data crossoverdesign; input subject group period1 period2; datalines; 1 1 25 26 2 1 47 38 3 1 53 37 4 2 48 35 5 2 44 53 6 2 45 44 ; proc sql; create table groupStats as select group, count(subject) as n, mean(period1) as meanper1, mean(period2) as meanper2, std(period1) as stdper1, std(period2) as stdper2, mean(meanper1-meanper2) as dbar from crossoverdesign group by group; create table stats as select sum(n-1) as sumn, sum(1/n) as expvar from groupStats; select * from stats; quit; data en; set groupStats; by group; stdper=stdper1-stdper2; run; proc print data=en; run; create table groups as select sum((n-1)*stdper**2) as sumVar from groups; select * from en; quit; Sdpooled=sqrt(sumVar)/sumn; Sdbar=(Sdpooled/2)*(sqrt(expvar)); tstat=dbar/Sdbar; tcrit=QUANTILE("T",0.95,sumn); pvalue=2*(1 - probt(tstat,sumn)); LB=dbar-tcrit*Sdbar; UB=dbar+tcrit*Sdbar; run; proc print data=en; run;
... View more