setwd("~/CStat_wis1WC4a")
set.seed(1234)
Teststat.H0<-vector()
for (i in 100000) {
H0.sample<-sample(x = c(0 ,1),
size = 41,
replace = TRUE,
prob = c(0.19, 0.81))
Teststat.H0[i]=mean(h0.sample)
}
hist(Teststat.H0)
P<-mean(Teststat.h0<=070)
Hallo @Michaelkyrg, welkom in deze groep .
Regarding your code take note of the following:
-
for (i in 100000)
loops over all elements in [100000] i.e. only the number 100000
- you give values to H0.sample but take the mean of h0.sample . These are different variables because 'case' is significant.
system
Closed
3
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.