#Biostatistics 150 #ZAR EXAMPLE 9.1 ZAR=read.table("ZarEX9.1.txt") ZAR attach(ZAR) X1=hindlen X2=forlen d=X1-X2 n=length(d) n dbar=mean(d) dbar sd=sqrt(var(d)) sd #PERFORMING PAIRED t-TEST: ?t.test #TWO SIDED CASE: t.test(X1,X2,alternative="two.sided",paired=T,conf.level=0.95) t.test(d,alternative="two.sided",conf.level=0.95) #NOTE ABOVE APPROACHES ARE EQUIVALENT #ONE SIDED CASE UPPER TAIL: t.test(X1,X2,alternative="greater",paired=T,conf.level=0.95) t.test(d,alternative="greater",conf.level=0.95) #ONE SIDED CASE LOWER TAIL: t.test(X1,X2,alternative="less",paired=T,conf.level=0.95) t.test(d,alternative="less",conf.level=0.95)