library("exams") include_supplement('ptest_hypothesen.schoice', recursive=TRUE) library("exams.forge") instruction <- NULL ptd <- proptest_data(size=50:100, prob=5*(2:9)/100, alternative='less') ptest <- proptest_num(x=ptd$x, n=ptd$n, pi0=ptd$pi0, alternative=ptd$alternative, alpha=ptd$alpha) N <- sample(seq(500, 1000, by=100), size=1) why <- "Man möchte beweisen, dass der Anteil der Haushalte mit Internetzugang $\\pi < \\pi_0$ ist." # h0 <- c(" = ", " \\neq ", " \\leq ", " < ", " \\geq ", " > ", " < ", " > ") h1 <- c(" \\neq ", " = ", " > ", " \\geq ", " < ", " \\leq ", " > ", " < ") hyp <- paste0('$H_0:\\pi', h0, "\\pi_0$ vs. $H_1:\\pi", h1, "\\pi_0$") tf <- rep(FALSE, length(hyp)) if (ptest$alternative=="greater") tf[(h0==' \\leq ') & (h1==' > ')] <- TRUE if (ptest$alternative=="less") tf[(h0==' \\geq ') & (h1==' < ')] <- TRUE if (ptest$alternative=="two.sided") tf[(h0==' = ') & (h1==' \\neq ')] <- TRUE tfind <- which(tf) sc <- to_choice(hyp, tf, order=random) sc$questions <- c(sc$questions, "Keines der Hypothesenpaare ist richtig") # Additional answer sc$solutions <- c(sc$solutions, FALSE) # TRUE or FALSE?
Ein Internetprovider plant eine spezielle Werbekampagne in Regionen mit einer unterdurchschnittlichen Internetnutzung. Kriterium soll ein Anteil von höchstens r 100*ptest$pi0
% Haushalten mit Netzzugang sein. Zur Auswahl passender Regionen führt er jeweils einfache Zufallsstichproben unter den Haushalten der Region durch. In einer Testregion hatten r ptest$x
von r ptest$n
Haushalten einen Internetzugang. Dem Test soll ein Signifikanzniveau von r 100*ptest$alpha
% zugrunde gelegt werden.
extype: schoice
exsolution: r mchoice2string(sc$solutions, single = TRUE)
exname: r knitr::current_input()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.