Description Usage Arguments Details Value Author(s) References Examples
This function generates a posterior density sample for a binary regression model using a Finite Polya tree prior for the link function.
1 2 3 |
formula |
a two-sided linear formula object describing the
model fit, with the response on the
left of a |
baseline |
a description of the baseline error distribution to
be used in the model. The baseline distributions considered by
|
prior |
a list giving the prior information. The list includes the following
parameters: |
mcmc |
a list giving the MCMC parameters. The list must include
the following integers: |
state |
a list giving the current value of the parameters. This list is used if the current analysis is the continuation of a previous analysis. |
status |
a logical variable indicating whether this run is new ( |
misc |
misclassification information. When used, this list must include
two objects, |
data |
data frame. |
na.action |
a function that indicates what should happen when the data
contain |
This generic function fits a semiparametric binary regression model using a Finite Polya tree prior (FPT) for the link function (see, Hanson, 2006; Jara, Garcia-Zattera and Lesaffre, 2006):
yi = I(Vi <= Xi β),\ i=1,…,n
V1,…,Vn | G ~ G
G | alpha ~ FPT^M(Pi,A)
where, the FPT is centered around a Logistic(0,1) distribution if the baseline is logistic
, by
taking each m level of the partition Pi to coincide
with the k/2^m, k=0,…,2^m quantile of the Logistic(0,1) distribution.
The family A={alphae: e \in E^{*}},
where E^{*}=\bigcup_{m=1}^{M} E^m
and E^m is the m-fold product of E=\{0,1\},
is specified as alpha{e1 … em}=α m^2.
To complete the model specification, independent hyperpriors are assumed,
alpha | a0, b0 ~ Gamma(a0,b0)
β | beta0, Sbeta0 ~ N(beta0,Sbeta0)
The precision parameter, alpha, of the FPT
prior
can be considered as random, having a gamma
distribution, Gamma(a0,b0),
or fixed at some particular value. To let alpha to be fixed at a particular
value, set a0 to NULL in the prior specification.
In the computational implementation of the model, Metropolis-Hastings steps are used to sample the posterior distribution of the regression coefficients and the precision parameter, as described in Hanson (2006), and Jara, Garcia-Zattera and Lesaffre (2006).
An object of class FPTbinary
representing the semiparametric logistic regression
model fit. Generic functions such as print
, plot
, predict
, summary
,
and anova
have methods to show the results of the fit.
The results include beta
, the precision parameter (alpha
), and the link
function.
The MCMC samples of the parameters and the errors in the model are stored in the object
thetasave
and randsave
, respectively. Both objects are included in the
list save.state
and are matrices which can be analyzed directly by functions
provided by the coda package.
The list state
in the output object contains the current value of the parameters
necessary to restart the analysis. If you want to specify different starting values
to run multiple chains set status=TRUE
and create the list state based on
this starting values. In this case the list state
must include the following objects:
beta |
giving the value of the regression coefficients. |
v |
giving the value of the errors (it must be consistent with |
,
y |
giving the value of the true response binary variable (only if the model considers correction for misclassification). |
alpha |
giving the value of the precision parameter. |
Alejandro Jara <atjara@uc.cl>
Tim Hanson <hansont@stat.sc.edu>
Hanson, T. (2006) Inference for Mixtures of Finite Polya tree models. Journal of the American Statistical Association, 101: 1548-1565.
Jara, A., Garcia-Zattera, M.J., Lesaffre, E. (2006) Semiparametric Bayesian Analysis of Misclassified Binary Data. XXIII International Biometric Conference, July 16-21, Montreal, Canada.
Lavine, M. (1992) Some aspects of Polya tree distributions for statistical modelling. The Annals of Statistics, 20: 1222-11235.
Lavine, M. (1994) More aspects of Polya tree distributions for statistical modelling. The Annals of Statistics, 22: 1161-1176.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | ## Not run:
# Prostate cancer data example
data(nodal)
attach(nodal)
lacid<-log(acid)
# Initial state
state <- NULL
# MCMC parameters
nburn<-20000
nsave<-10000
nskip<-10
ndisplay<-100
mcmc <- list(nburn=nburn,nsave=nsave,
nskip=nskip,ndisplay=ndisplay,
tune1=1.1,tune2=1.1)
# Prior distribution
prior <- list(alpha=1, beta0=c(0,rep(0.75,5)),
Sbeta0=diag(c(100,rep(25,5)),6),M=5)
# Fitting the Finite Polya tree model
fit1 <- FPTbinary(ssln~age+lacid+xray+size+grade,
prior=prior,mcmc=mcmc,
state=state,status=TRUE)
fit1
# Summary with HPD and Credibility intervals
summary(fit1)
summary(fit1,hpd=FALSE)
# Plot model parameters (to see the plots gradually set ask=TRUE)
plot(fit1)
plot(fit1,nfigr=2,nfigc=2)
# Plot an specific model parameter (to see the plots gradually
# set ask=TRUE)
plot(fit1,ask=FALSE,nfigr=1,nfigc=2,param="xray")
plot(fit1,ask=FALSE,param="link",nfigc=1,nfigr=1)
# Table of Pseudo Contour Probabilities
anova(fit1)
# Fitting parametric models
nburn<-20000
nsave<-10000
nskip<-10
ndisplay<-100
mcmc <- list(nburn=nburn,nsave=nsave,
nskip=nskip,ndisplay=ndisplay,
tune=1.1)
fit2 <- Pbinary(ssln~age+lacid+xray+size+grade,link="probit",
prior=prior,mcmc=mcmc,state=state,status=TRUE)
fit3 <- Pbinary(ssln~age+lacid+xray+size+grade,link="logit",
prior=prior,mcmc=mcmc,state=state,status=TRUE)
# Model comparison
DPpsBF(fit1,fit2,fit3)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.