CDOoDocuments.StdDocumentDescDocuments.DocumentDescContainers.ViewDescViews.ViewDescStores.StoreDescDocuments.ModelDescContainers.ModelDescModels.ModelDescStores.ElemDescF >TextViews.StdViewDescTextViews.ViewDesc
TextModels.StdModelDescTextModels.ModelDescgTextModels.AttributesDesc+Arial.
+ArialPS
- VerdanaPSM
K VerdanaPSw
CourierCancer: difference in two binomial proportions
The following simple model is drawn from an example in Johnson and Albert 's Ordinal Data Modeling (p35), using data collected in a study by H.F. Dorn ("The Relationship of Cancer of the Lung and the Use of Tobacco", The American Statistician, 1954, V8:7-13). A sample of 86 lung-cancer partients and a sample of 86 controls were questioned about their smoking habits. The two groups were chosen to represent random samples from a subpopulation of lung-cancer patients and an otherwise similar population of cancer-free individuals. Of the cancer patients, 83 out of 86 were smokers; among the control group 72 out of 86 were smokers. The scientific question of interest was to assess the difference between the smoking habits in the two groups.
In implementing this model in WinBUGS, we have just two data points (cancer patients and control group) and a binomial sampling model, in which the population proportions of smokers in each group appear as parameters. Quantities of interest such as the difference in the population proportions and the log of the odds ratio are computed as auxiliary quantities. Uniform priors on the population proportions are used in this example.
An alternative parameterization appears below, in which the difference in the population proportions of probabilities is modeled directly, instead of appearing as an auxilary quantity.
model{
## sampling model for the data
for(i in 1:2){ ## loop over observations
r[i] ~ dbin(p[i],n[i]) ## p is unknown parameter
}
## priors
p[1] ~ dunif(0,1) ## uniform distributions
p[2] ~ dunif(0,1)
## compute quantities of interest
delta <- p[1] - p[2] ## difference in probs
delta.up <- step(delta) ## is delta > 0???
## log of the odds ratio
lambda <- log( (p[1]/(1-p[1])) / (p[2]/(1-p[2])) );
lambda.up <- step(lambda) ## is lambda > 0???
}
## data
list(r=c(83,72),n=c(86,86))
Alternative Parameterization:
model{
## sampling model for the data
for(i in 1:2){ ## loop over observations
r[i] ~ dbin(p[i],n[i]) ## p is unknown parameter
}
## compute quantities of interest
## log of the odds ratio
delta <- p[1] - p[2]
lambda <- log( (p[1]/(1-p[1])) / (p[2]/(1-p[2])) );
lambda.up <- step(lambda) ## is lambda > 0???
## priors
v[2] ~ dnorm(0,.01); ## vague prior, logits
logit(p[2]) <- v[2]; ## convert to probability
v[1] <- v[2] + vdelta; ## difference in logits
vdelta ~ dnorm(0,.01); ## vague prior on difference
logit(p[1]) <- v[1]; ## convert to probability
}
## data
list(r=c(83,72),n=c(86,86))
## initial values
list(v=c(NA,.5),vdelta=0)
TextControllers.StdCtrlDescTextControllers.ControllerDescContainers.ControllerDescControllers.ControllerDesc TextRulers.StdRulerDescTextRulers.RulerDescTextRulers.StdStyleDescTextRulers.StyleDescZTextRulers.AttributesDesc$0ZGo
*<[@Documents.ControllerDesc vz
pk ~