我正在尝试将二进制结果“SECONDARY.LEVEL”建模为该数据集中其他三个变量的函数。我正在使用该MCMCpack
包进行贝叶斯建模。有人可以解释为什么MCMCprobit()
有效,但不是MCMClogit()
吗?下面给出了代码和前几行输出。
#Read in data
df = read.csv("http://dl.dropbox.com/u/1791181/MCMC.csv")
概率工作:
mcmc.probit = MCMCprobit(SECONDARY.LEVEL ~ AGE + SEX + as.factor(DISTRICT), mcmc=1000, data=df)
head(summary(mcmc.probit)$statistics, n=15)
Mean SD Naive SE Time-series SE
(Intercept) 0.150093347 0.109792702 0.0034719501 0.0059589451
AGE -0.035112684 0.005551112 0.0001755416 0.0003118349
SEXMale 0.207912526 0.026288448 0.0008313137 0.0011590922
as.factor(DISTRICT)2 0.004684505 0.068300292 0.0021598449 0.0028876137
as.factor(DISTRICT)3 0.147462569 0.077003268 0.0024350571 0.0036086218
as.factor(DISTRICT)4 0.056207898 0.070746208 0.0022371915 0.0030940116
as.factor(DISTRICT)5 0.262208868 0.074049641 0.0023416553 0.0035314500
as.factor(DISTRICT)6 0.167194019 0.076774267 0.0024278155 0.0037526433
as.factor(DISTRICT)7 -0.030666654 0.079221987 0.0025052192 0.0045243228
as.factor(DISTRICT)8 0.256155556 0.086851907 0.0027464985 0.0043024813
as.factor(DISTRICT)9 0.220563392 0.081925283 0.0025907049 0.0036374888
as.factor(DISTRICT)10 0.048681988 0.084193610 0.0026624357 0.0037311155
as.factor(DISTRICT)11 0.046235838 0.077788116 0.0024598762 0.0041413425
as.factor(DISTRICT)12 0.055248182 0.084691712 0.0026781871 0.0039077209
as.factor(DISTRICT)13 0.180067061 0.077430509 0.0024485677 0.0035813944
但不是logit:
mcmc.logit = MCMClogit(SECONDARY.LEVEL ~ AGE + SEX + as.factor(DISTRICT), mcmc=1000, data=df)
head(summary(mcmc.logit)$statistics, n=15)
Mean SD Naive SE Time-series SE
(Intercept) 0.22304927 0 0 0
AGE -0.05566763 0 0 0
SEXMale 0.33312032 0 0 0
as.factor(DISTRICT)2 0.01497950 0 0 0
as.factor(DISTRICT)3 0.24880013 0 0 0
as.factor(DISTRICT)4 0.09670442 0 0 0
as.factor(DISTRICT)5 0.42470223 0 0 0
as.factor(DISTRICT)6 0.27617894 0 0 0
as.factor(DISTRICT)7 -0.03446564 0 0 0
as.factor(DISTRICT)8 0.41404924 0 0 0
as.factor(DISTRICT)9 0.35816907 0 0 0
as.factor(DISTRICT)10 0.08551302 0 0 0
as.factor(DISTRICT)11 0.07437629 0 0 0
as.factor(DISTRICT)12 0.09701028 0 0 0
as.factor(DISTRICT)13 0.29723229 0 0 0