# NOT RUN {
X <- hrsRcePred
top1e <- X[X$sbjType=="Expert","top1"]
top1n <- X[X$sbjType=="NonXpert","top1"]
top3e <- X[X$sbjType=="Expert","top3"]
top3n <- X[X$sbjType=="NonXpert","top3"]
dbfit1e <- mleDb(top1e,ntop=10,zeta=TRUE)
dbfit1n <- mleDb(top1n,ntop=10,zeta=TRUE)
dbfit3e <- mleDb(top3e,ntop=10,zeta=TRUE)
dbfit3n <- mleDb(top3n,ntop=10,zeta=TRUE)
# Set seeds to get repeatable Monte Carlo p-values.
# }
# NOT RUN {
# Takes too long.
print(gof(dbfit1e,obsd=top1e,MC=TRUE,maxit=5000,verb=TRUE,seed=49)$pval) # 0.02
print(gof(dbfit1n,obsd=top1n,MC=TRUE,verb=TRUE,seed=128)$pval) # 0.79
print(gof(dbfit3e,obsd=top3e,MC=TRUE,verb=TRUE,seed=303)$pval) # 0.35
print(gof(dbfit3n,obsd=top3n,MC=TRUE,maxit=3000,verb=TRUE,seed=24)$pval) # 0.40
# }
# NOT RUN {
bbfit1e <- mleBb(top1e,size=10)
bbfit1n <- mleBb(top1n,size=10)
bbfit3e <- mleBb(top3e,size=10)
bbfit3n <- mleBb(top3n,size=10)
# Set seeds to get repeatable Monte Carlo p-values.
# }
# NOT RUN {
# Takes too long.
print(gof(bbfit1e,obsd=top1e,MC=TRUE,verb=TRUE,seed=792)$pval) # 0.11
print(gof(bbfit1n,obsd=top1n,MC=TRUE,verb=TRUE,seed=48)$pval) # 0.64
print(gof(bbfit3e,obsd=top3e,MC=TRUE,verb=TRUE,seed=969)$pval) # 0.62
print(gof(bbfit3n,obsd=top3n,MC=TRUE,verb=TRUE,seed=834)$pval) # 0.75
# }
# NOT RUN {
# Reality check: goodness of fit tests for the fit of just plain *binomial*
# distributions to these data sets yielded Monte Carlo p-values equal to
# 0.22, 0.17, 0.32 and 0.73 respectively. I.e. binomial fits appear to
# work just fine!
# }
Run the code above in your browser using DataLab