options(scipen=999)
options(digits=9)

x1=c(76,60,85,58,91,75,82,64,79,88)
x2=c(81,52,87,70,86,77,90,63,85,83)
d=x1-x2;d
dbar=mean(d);dbar
s=sd(d);s
n=length(d);n
standard_error=s/sqrt(n)
standard_error
df=n-1
df
alpha=0.05
ttable=qt(1-alpha/2,df);ttable
confi_level=ttable*standard_error;confi_level
lower_limit=dbar-confi_level;lower_limit
upper_limit=dbar+confi_level;upper_limit




library("TeachingDemos")
x1=c(76,60,85,58,91,75,82,64,79,88)
x2=c(81,52,87,70,86,77,90,63,85,83)
t.test(x1,x2,pair=TRUE,conf.level=0.95)

