# single sample t test

library(Rcmdr)
## below generated by Rcmdr 
mydataframe <- 
  read.table("http://www.robin-beaumont.co.uk/virtualclassroom/book2data/t_test_1_sample_ex1.dat",
   header=TRUE, sep="\t", na.strings="NA", dec=".", strip.white=TRUE)
library(relimp, pos=4)
showData(mydataframe, placement='-20+200', font=getRcmdr('logFont'), 
  maxwidth=80, maxheight=30)
summary(mydataframe)
library(abind, pos=4)
library(e1071, pos=4)
numSummary(mydataframe[,"result"], statistics=c("mean", "sd", "IQR", 
  "quantiles"), quantiles=c(0,.25,.5,.75,1))
t.test(mydataframe$result, alternative='two.sided', mu=100, conf.level=.95)

.x <- seq(-4.14, 4.14, length.out=1000)
plotDistr(.x, dt(.x, df=14), cdf=FALSE, xlab="x", ylab="Density", 
  main=paste("t Distribution:  Degrees of freedom=14"))
remove(.x)
##################################
# Alternatively doing it in R directly
mydataframe <-read.delim("http://www.robin-beaumont.co.uk/virtualclassroom/book2data/t_test_1_sample_ex1.dat")

#######  local - ignore:
# mydataframe <- read.delim("D:\\web_sites_mine\\HIcourseweb 
# new\\book2data\\t_test_1_sample_ex1.dat", header=TRUE)
#######
names(mydataframe)
str(mydataframe)
mydataframe
t.test(mydataframe, mu=100)
# or as in chapter:

result <- c( 90, 87, 79, 99, 98, 91, 101, 104, 100,  104, 88, 94, 96, 99, 103)
t.test(result, mu=100)

# added


