> qbinom(.025,100,.5)
[1] 40
> qbinom(.975,100,.5)
[1] 60
So in this experiment, if the number of heads we saw was between 40 and 60 (out of 100
tosses), we would tentatively accept the null hypothesis; formally we would say that theres
not enough evidenc
the levels of the cultivar, i.e. do t-tests for 1 vs. 2, 1 vs. 3, and 2 vs. 3. This is a very bad
idea for at least two reasons:
1. One of the main goals of ANOVA is to combine together all our data, so that we
can more accurately estimate the residual va
15.1
Linear Regression
Linear regression is a very popular procedure for modeling the value of one variable on the
value(s) of one or more other variables. The variable that were trying to model or predict
is known as the dependent variable, and the varia
mkput = function(sym)cfw_
function(.)cfw_
calcinp <- paste(calcinp,sym,sep=)
tkconfigure(display,text=calcinp)
Notice that were refering to an object called display, even though we havent dened it
yet. R uses a technique called lazy evaluation which mea
This correction is performed by default, but can be shut o by using the var.equal=TRUE
argument. Lets see how it works:
> t.test(x,y)
Welch Two Sample t-test
data: x and y
t = -0.8103, df = 17.277, p-value = 0.4288
alternative hypothesis: true difference
318
Chapter 16
Analysis of Variance
319
16.1
Analysis of Variance
In its simplest form, analysis of variance (often abbreviated as ANOVA), can be thought of
as a generalization of the t-test, because it allows us to test the hypothesis that the means
of a
Note that only the specic widget for which background= was set changes if you want
to change the background for the entire GUI, youll probably have to pass the background=
argument to every widget you use.
251
12.6
Plotting
When developing a TK-based GUI
sense for the wine data, suppose we wanted to add Cultivar and all the interactions between
Cultivar and the independent variables to our original regression model. The rst step is
to create a vector of the variables we want to work with. This can usually
Many of the variables seem to be correlated with each other, so its dicult to see which is
causing the problem. A statistic known as VIF (Variance Ination Factor) can be very useful
in situations like this. In R, the vif function in the car package will p
The plots look much better, so well continue with the analysis of the log of retention.
Df Sum Sq Mean Sq F value
Pr(>F)
level
2 15.588
7.794 22.5241 7.91e-09 *
treatment
1 2.074
2.074 5.9931 0.01607 *
level:treatment
2 0.810
0.405 1.1708 0.31426
Residual