TU Wien:Statistik und Wahrscheinlichkeitstheorie UE (Bura)/Übungen 2019W/9.3
Zur Navigation springen
Zur Suche springen
- Processors - Part 2
Use the ANOVA to test the null hypothesis that all data were sampled from the same distribution, on the 5% significance level
- (a) Calculate the f-Statistic and the P-value (without using
anova()
) - (b) Double-check your statistics using anova()
- (c) Formulate a result
- (d) Would you say that the assumptions of the ANOVA are fulfilled?
Lösungsvorschlag von Gittenburg[Bearbeiten | Quelltext bearbeiten]
--Gittenburg 21:14, 9. Dez. 2019 (CET)
load('temperatures.Rdata')
# (a)
ni = rapply(temp, length)
x = unlist(temp)
k = length(temp)
n = length(x)
xi_bar = rapply(temp, mean)
f = (sum(ni * ((xi_bar - mean(x))^2)) / (k - 1)) / (sum((x - rep(xi_bar, ni))^2) / (n-k))
P = pf(f, df1=k-1, df2=n-k, lower.tail=F)
# (b)
gr = factor(rep(1:k, ni))
anova(aov(x ~ gr))
(c) TBD
(d) TBD