Search this site

Just a note

# input paired observations pre=c(7.3,6.8,7.3,4.8,5.6,6.2,5.6,4.5,6.3,6.7,5.4,6.8,6.5,7.7,8.3) post=c(9.1,8.6,7.1,9.6,9.7,9.8,9.1,5.2,9.4,9.3,4.9,10.1,6.3,10.2,10.9) d=post-pre # find differences # find number of differences n=length(d) # assumes no missing values! # do 2-tailed paired t-test md=mean(d) # observed mean difference se=sd(d)/sqrt(n) # estimated SE of diffs Md=0 # true mean if H0 true t=(md-Md)/se # observed t if H0=TRUE p=pt(t, n-1) # proportion of t-values < observed t p=.5-abs(p-.5) # when p > 0.5 then p = 1-p p*2 # 2-tailed P-value # 95% conf. lims. t=qt(.05/2,n-1) # 2.5% quantile of t md # mean difference md+t*se # lower 95% confidence limit of mean md-t*se # upper 95% confidence limit of mean

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.