# Data from Muller, F. H., Tobakmissbrauch und Lungencarcinom,
# Zeit. f. Krebsforsch. 49, 57-85, 1939. One of the early papers
# investigating the relation between smoking and lung cancer.
# Number of heavy smokers in one group of 86 lung cancer patients
# and one group of 86 healthy individuals.
no_heavy_smokers <- c(56, 31)
no_cases <- c(86, 86)
bayes.prop.test(no_heavy_smokers, no_cases)
# Save the return value in order to inspect the model result further.
fit <- bayes.prop.test(no_heavy_smokers, no_cases)
summary(fit)
plot(fit)
# MCMC diagnostics (should not be necessary for such a simple model)
diagnostics(fit)
# Print out the R code to run the model. This can be copy'n'pasted into
# an R-script and further modified.
model.code(fit)
Run the code above in your browser using DataLab