binomial test and chi-square goodness of fit test

Hi, I have some trouble to perform a binomial test and chi-square goodness of fit test with a simulated null distribution. The following is the question specifically:

In 1955, John Wayne played Genghis Khan in a movie called The Conqueror. It was not an artistic success. More unfortunately, the movie was filmed downwind of the site of 11 previous aboveground nuclear bomb tests. Of the 240 people who worked on this movie, 105 had been diagnosed with cancer by the early 1980s, including Wayne, his costars, and the director. According to large-scale epidemiological data, only about 16% of people of this age group, on average, should have been stricken with cancer within this time frame. We want to know whether there is evidence for an increased cancer risk for people associated with this film. Assume that this probability is the same for each member of the cast

This is what I got:
canc <- double(100)
for(i in 1:100){
cancer <- sample(c("can", "nocan"), size=240, prob=c(0.16, 0.84), replace=TRUE)
canc[i] <- sum(cancer == "can")
}
#p value
pvalcanc <- sum(canc <= 105)/length(canc)
pvalcanc
and I got p value =1

I just got the p value, and I don't know how to continue to the binomial test (since I cannot use the binomial function directly)
And also how can I perform the goodness of fit test, just coding for the chi-square equation?
Thank you so much in advance!

Hi,
Please take a look into our homework policy.
Homework inspired questions are welcome, but they shouldn't be verbatim.

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.