TU Wien:Statistik und Wahrscheinlichkeitstheorie UE (Levajkovic)/Übungen 2023W/HW11.1

Aus VoWi
Zur Navigation springen Zur Suche springen
Rolling die, part 1

A -sided die with colored sides was rolled times. The outcomes are stored in the file die.Rdata. (Each side appeared at least once.)

(a) What is ? What is ?
(b) Visualize the relative frequencies in a colored barplot and add the standard error of each frequency.
(c) Given your graphic, what is your opinion on the assertion: 'the die is fair'?
Dieses Beispiel ist als verified_by_tutor markiert. Ist dies falsch oder ungenau? Aktualisiere den Lösungsstatus (Details: Vorlage:Beispiel)


Lösung von Tutorin[Bearbeiten | Quelltext bearbeiten]

(a)[Bearbeiten | Quelltext bearbeiten]

# Load data
load(file="die.Rdata")

# Compute statistics
n <- lentgh(w); n
w <- table(w); length(tab)

and .

(b)[Bearbeiten | Quelltext bearbeiten]

# Compute statistics
h <- as.vector(tab)/n; h
sem <- sqrt(h*(1-h)/n)

# Make barplot
co <- c("blue", "orange", "red", "green")
bar <- barplot(tab/n, col=co, main="Relative Häufigkeiten (n=150)", ylim=c(0, max(h+sem)), las=1)
b <- as.vector(bar)
arrows(bar, h-sem, bar, h+sem, code=3, col="darkgoldenrod", length=0.1, angle=90, lwd=3, xpd=TRUE)

(c)[Bearbeiten | Quelltext bearbeiten]

It is very typical to observe the corresponding frequencies if the dice is fair (standard error: 'The frequencies are partly far apart')