############################################
This is the R script to fit Bayesian Cell Mixture Model
May, 2008 
############################################
Library required: 
-----------------------
library(BRugs); library(MASS)        
                              
Arguments: 
----------------          
data: currently applicable to quantitative TMA data. Data should have a subjID column; a yij column of TMA staining intensity; a n1ij column of postively stained cell counts (staining area); a n0ij column of negatively stained cell counts (non-staining area); covariates columns of clinical covariates of interest; a time column of survival time, and an event column of survival events.                                                                                             
hTheta: takes value in (1,2,3) to specify the 1=proportion of staining, 2=mean intensity, or 3=the composite mean as the expression characteristic to associate with patient survival in the joint model.

Delta: the dispersion parameter in th hGamma model

J: Number of intervals in the piecewise constant hazard model
                                                                                            
Value: 
----------                                                                                    
out: summary table of the model fit, returning the estimate of beta and additional coefficients with lower and upper 95% credible region.

pi.h: fitted proportion of staining

muipos.h: fitted mean staining intensity

mui.h: fitted composite mean intensity


Misc:
The three text files: jointSurvivalCMM1, jointSurvivalCMM2, and jointSurvivalCMM3 contain WINBUGS model corresponding to which hTheta value is specified. They need to be put in the current R work directory. 

                                               


