楼主: 再找找
1443 3

[问答] 关于R程序的相关问题::悬赏50论坛币 [推广有奖]

  • 0关注
  • 0粉丝

高中生

65%

还不是VIP/贵宾

-

威望
0
论坛币
380 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
889 点
帖子
8
精华
0
在线时间
48 小时
注册时间
2011-11-11
最后登录
2020-3-25

楼主
再找找 学生认证  发表于 2014-11-12 19:31:17 |AI写论文
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)











关键词:悬赏50论坛币 50论坛币 0论坛币 论坛币 R程序 程序 R following included command library between

沙发
再找找 学生认证  发表于 2014-11-12 19:31:50
希望大家能够帮助 我解决问题 谢谢大家。

藤椅
xucaifeng66 发表于 2014-11-13 16:21:30
好长,具体什么问题

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

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-19 11:02