ESERCIZI 5
1. Identify the “population” in your data sets. Discuss the representativeness of your sample Discuss the source of randomness in your dataset. Identify parameter to be estimated and more than one estimator. Discuss which you would prefer and why. Do you have enough data for the law of large numbers to kick in?
2. The following program R build the plots of the density probability functions under the hypotheses H0: p = 0.3 H1: p = 0.5
with α = 0.05 (p. 9 of the slides “Statistical inference – Part 2”)
n=20;p_0=0.3;p_1=0.7;a=0.05 s=qbinom((1-a),n,p_0) x=seq(0,n)
y_0=dbinom(x,n,p_0) y_1=dbinom(x,n,p_1)
plot(x+0.1,y_0,xlim=c(0,n),ylim=c(0,.2),type="h", lwd=3,xlab=" ",ylab=" ",col="red")
par(new=T)
plot(x-0.1,y_1,xlim=c(0,n),ylim=c(0,.2),type="h", lwd=3,xlab=" ",ylab=" ")
abline(h=0);abline(v=s+.5, col="blue",lwd=3)
## the bars are drawn slightly shifted (x+0.1 and x-0.1) for better visualisation
Consider a binomial experiment with n = 20. For each of the following hypotheses and level α:
• compute the threshold for the successes to testing the hypotheses
• build the plots of the density probability functions under the hypotheses
• compute the probability of the type 2 error (β) 1. H0 : p = 0.3 H1 : p = 0.5 α = 0.05 2. H0 : p = 0.5 H1 : p = 0.3 α = 0.05 3. H0 : p = 0.5 H1 : p = 0.3 α = 0.01 Comment the results.
1