ANALYSIS OF RAT TUMOUR DATA USING MATLAB
The model:
- y(i) independent binomial(n(i), theta(i))
- theta(i) independent beta(alpha, beta)
- (alpha, beta) have density proportional to (alpha+beta)^(-5/2)
MATLAB m-file to do the analysis
MATLAB function to compute the log posterior of
(log(alpha/beta), log(alpha+beta))
MATLAB function to simulated from a discrete
distribution
(Also need functions from MATLAB statistics toolbox.)
SUMMARIZING THE POSTERIOR DISTRIBUTION:
Compute the marginal posterior density of
(log(alpha/beta), log(alpha+beta)) on a 50 by 50 grid.
Take a simulated sample from the discrete posterior distribution
of (log(alpha/beta), log(alpha+beta)).
Transform the above simulated values to
get a sample from the posterior distribution of (alpha, beta).
Simulate values of the theta(i) from beta distributions.
Summarize the posterior distribution of each theta(i) with
a median and a 95% credible interval. Graph the set of posterior
distributions using errobars.