Just a note
t-test of differences due to interaction between time period & treatment.
#input data g1t1=c(43,41,44,47) g1t2=c(15,19,27,26) g2t1=c(21,25,23,30) g2t2=c(33,39,41,40)
# difference between means of subject totals for each group y1=g1t1+g1t2 y2=g2t1+g2t2 n1=length(y1); n2=length(y2) # assume no missing points # EQ var t-test df1=n1-1; df2=n2-1 # estimate standard error se=sqrt((var(y1)*df1+var(y2)*df2)/(df1+df2)*(n1+n2)/(n1*n2)) t=(mean(y1)-mean(y2))/se # observed t-statistic p=pt(t,df1+df2) # test t p=.5-abs(p-.5) # when p > 0.5 then p = 1-p p*2 # 2-tailed P-value
Except where otherwise specified, all text and images on this page are copyright InfluentialPoints, all rights reserved. Images not copyright InfluentialPoints credit their source on web-pages attached via hypertext links from those images.