全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
1386 3
2014-11-12
悬赏 50 个论坛币 未解决
各位老师好。
小弟 学习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,希望哪位大哥能够演示一下 使用自己的外部数据的整个过程。
谢谢
HSROC.pdf
大小:(370.51 KB)

 马上下载

HSROC_R_Tutorial.pdf
大小:(1.41 MB)

 马上下载

abc.xls
大小:(25 KB)

 马上下载













二维码

扫码加我 拉你入群

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

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

全部回复
2014-11-12 19:31:50
希望大家能够帮助 我解决问题 谢谢大家。
二维码

扫码加我 拉你入群

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

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

2014-11-13 16:21:30
好长,具体什么问题
二维码

扫码加我 拉你入群

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

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

2014-11-14 22:53:37
xucaifeng66 发表于 2014-11-13 16:21
好长,具体什么问题
具体 就是按照他们命令 使用我的外部数据  运行一下程序
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群