貝氏統計分析常使用OpenBUGS統計軟體,而研究者通過簡單的操作就能進行分析,OpenBUGS的官方網站上有清楚的使用教學,也提供許多例子讓研究者練習操作。另外,它還能和一般常見的統計軟體搭配使用,例如:SAS、R、Matlab、Excel等,這也大大增加了貝氏統計在實務應用上的普遍性。 此篇論文以R軟體中的R2OpenBUGS套件對羅吉斯迴歸模型進行貝氏統計分析,首先在R中載入R2OpenBUGS套件後,在R環境下處理樣本的資料,接著利用R2OpenBUGS套件呼叫OpenBUGS來分析資料及估計參數,利用兩者的搭配可以較快速的作很多次模擬,讓我們能夠更有效率的進行貝氏統計分析。
OpenBUGS is so far the best statistical software for Bayesian analysis. Users only need to specify the model likelihood, the priors of parameters, the initial values and the data. Then, the OpenBUGS will apply Metropolis-Hastings algorithm to update parameters and estimate parameters by MCMC. However, the interface of OpenBUGS is not friendly. The operation procedure to run OpenBUGS is tedious. With the use of the R2OpenBUGS package, we can call OpenBUGS in R environment and perform other statistical procedures. Logistic regression is a regression model for dichotomous dependent variable. The application of such model ranges from biology, business, and some other fields. In this paper, we propose to a random sample of logistic regression data using R, and then analyze by OpenBUGS via the R package R2OpenBUGS. Both R classical statistical analysis and Bayesian approach are performed using the real data and simulated data. And they agree to the similar results. Also, when the prior knowledge of parameters is clear, we see the Bayesian method yields to better estimation.