inst/APCode/Ch10.R

### R code from vignette source 'Ch10.rnw'

###################################################
### code chunk number 1: setup
###################################################
source("GenericSettings.R")


###################################################
### code chunk number 2: Ch10.rnw:18-19
###################################################
qt(c(0.025, 0.975), df=24)


###################################################
### code chunk number 3: Ch10.rnw:24-25
###################################################
PhoneCalls=c(0.19,0.78,0.96,1.31,2.78,3.16,4.15,4.67,4.85,6.5,7.35,8.01,8.29,12.06,31.75,32.52,33.91,36.71,72.89)


###################################################
### code chunk number 4: Ch10.rnw:29-31
###################################################
t.test(PhoneCalls)
wilcox.test(PhoneCalls, conf.int=TRUE)


###################################################
### code chunk number 5: Ch10.rnw:47-49
###################################################
data(Reflexes, package="MindOnStats")
str(Reflexes)


###################################################
### code chunk number 6: Ch10.rnw:52-55
###################################################
attach(Reflexes)
t.test(RightFluoro, RightClear, paired=TRUE)
detach(Reflexes)


###################################################
### code chunk number 7: Ch10.rnw:59-60
###################################################
data(HoldingBreath, package="MindOnStats")


###################################################
### code chunk number 8: Ch10.rnw:63-65
###################################################
t.test(Time~Smoker, data=HoldingBreath)
t.test(Time~Smoker, data=HoldingBreath, var.equal=TRUE)


###################################################
### code chunk number 9: Ch10.rnw:76-79
###################################################
qchisq(c(0.025,0.975), df=12)
12*0.024^2/qchisq(c(0.025,0.975), df=12)
sqrt(12*0.024^2/qchisq(c(0.975,0.025), df=12))

Try the MindOnStats package in your browser

Any scripts or data that you put into this service are public.

MindOnStats documentation built on May 2, 2019, 9:42 a.m.