搜索
人大经济论坛 附件下载

附件下载

所在主题:
文件名:  HSROC.pdf
资料下载链接地址: https://bbs.pinggu.org/a-1671982.html
附件大小:
370.51 KB   举报本内容
各位老师好。
小弟 学习R软件 的使用
遇到一个问题:关于HSROC程序包的使用问题
2.1 Data preparation
After having installed the package, the library can be loaded with the following command :
> library(HSROC)
The data on MR imaging is included in the library and can be loaded as follows :
> data(MRI)
> MRI
++ +- -+ --
1 9 2 2 44
2 3 6 5 32
3 3 2 1 16
4 3 1 12 44
5 1 1 6 16
6 7 2 22 167
3
7 12 4 4 29
8 23 5 14 230
9 8 5 5 53
10 16 2 2 22
The columns ++; +-; -+; -- represent the results of the cross tabulation between MRI (the test under evaluation) and histologic/cytologic specimens obtained by
surgery or lymph node biopsy (reference test). The colummn headings ++; +􀀀; 􀀀+; 􀀀􀀀
correspond to (MRI +, reference +), (MRI +, reference -), (MRI -, reference +) and (MRI -,

reference -), respectively.
In order to estimate the parameters of the conditional independence model, we use the function HSROC. The arguments论据 of the function are as follows :
(init初始化,null 零)
> args(HSROC)

function (data, iter.num, init = NULL, sub_rs = NULL, first.run = TRUE,
path = getwd(), refresh = 100, prior.SEref = NULL, prior.SPref = NULL,
prior_PI = c(0, 1), prior_LAMBDA = c(-3, 3), prior_THETA = c(-1.5,
1.5), prior_sd_alpha = list(0, 2, "sd"), prior_sd_theta = list(0,
2, "sd"), prior_beta = c(-0.75, 0.75))
> init.alpha = c(2.51, 2.54, 3.81, 2.41, 2.64, 2.70, 3.31, 3.39, 3.11, 2.99)
> init.theta = c(-0.51, -0.39, 0.33, -2.06, -0.14, -0.08, 1.11, 0.38, -0.86,
+-0.38)
> init.s1 = rep(0.9,10)
> init.c1 = rep(0.9,10)
> init.pi = c(0.38, 0.17, 0.78, 0.07, 0.74, 0.84, 0.52, 0.95, 0.07, 0.56)


> init_within = cbind(init.alpha, init.theta, init.s1, init.c1, init.pi)
> init_within = cbind(init.theta, init.alpha, init.s1, init.c1, init.pi)
> init.THETA = -0.16
> init.sig.theta = 0.75
> init.LAMBDA = 2.58
> init.sig.alpha = 0.5
> init.beta = 0.25

> init_between = c(init.THETA, init.sig.theta, init.LAMBDA, init.sig.alpha, init.beta)
> init = list(init_within, init_between)
> HSROC(data=MRI, iter.num=50000, init=init )
> args(HSROCSummary)
function (data, burn_in = 0, iter.keep = NULL, Thin = 1, sub_rs = NULL,
point_estimate = c("median", "mean"), summary.path = getwd(),
chain = getwd(), tv = NULL, digit = 6, print_plot = FALSE,
plot.ind.studies = TRUE, conf_region = TRUE, predict_region = TRUE,

col.pooled.estimate = "red", col.predict.region = "blue",
lty.conf.region = "dotdash", lty.predict.region = "dotted",
region_level = 0.95, trunc_low = 0.025, trunc_up = 0.025)

For our example, we call the function as follows :
> HSROCSummary(data = MRI, burn_in=10000, Thin=2, print_plot=TRUE )

> dir.create("C:/MRI/Chain1")
> HSROC(data=MRI, iter.num=50000, init=init, path="C:/MRI/Chain1" )
> dir.create("C:/MRI/Chain2")
> HSROC(data=MRI, iter.num=50000, init=init2, path="C:/MRI/Chain2" )

> dir.create("C:/MRI/Chain3")
> HSROC(data=MRI, iter.num=50000, init=init3, path="C:/MRI/Chain3" )

> HSROCSummary(data = MRI, burn_in=10000, Thin=2, print_plot=TRUE,
+ path="C:/MRI/All_Chains", chain=list("C:/MRI/Chain1","C:/MRI/Chain2",
+ "C:/MRI/Chain3") )

小弟试过能复制以上命令,但是小弟现在想
自己运行自己的数据,我把数据呈上。命名为abc,希望哪位大哥能够演示一下 使用自己的外部数据的整个过程。
谢谢














    熟悉论坛请点击新手指南
下载说明
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。
2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。
3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。
(如有侵权,欢迎举报)
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

GMT+8, 2026-1-19 14:37