resamp.test(spacodiR)
resamp.test()所属R语言包:spacodiR
statistical comparison of sets of values by randomization
套按随机的值的统计比较
译者:生物统计家园网 机器人LoveR
描述----------Description----------
compares means by bootstrap resampling of differences between empirical distributions
比较手段,引导重采样的经验分布之间的差异
用法----------Usage----------
resamp.test(obs = obs, exp = exp, mu = 0, iter = 10000, two.tailed = FALSE, na.rm = TRUE)
参数----------Arguments----------
参数:obs
a vector of numeric values
一个向量的数值
参数:exp
a vector of numeric values
一个向量的数值
参数:mu
the true difference in means
真正的差别在手段
参数:iter
number of randomization comparisons to perform
比较的随机数执行
参数:two.tailed
Boolean; as default, the test is performed under a one-tailed assumption
布尔值作为默认值,测试单尾的假设下进行的
参数:na.rm
whether to remove NA data
是否要删除NA数据
Details
详细信息----------Details----------
If a single value is supplied for obs, this test equates to finding the quantile in exp in which obs would be found (under a one-tailed test);
如果提供的值obs,本次测试等同于寻找位数exp的obs会被发现(下单尾检验);
值----------Value----------
A list, whose contents are determined by the above argument:
的列表,其内容是由上述论点:
参数:unnamed value
if two.tailed=TRUE, this is the two-tailed p-value
如果two.tailed=TRUE,这是双尾p值
参数:diffs
the full resampling distribution of differences between obs and exp, given mu
全重采样分布之间的差异obs和exp,mu
参数:greater
if two.tailed=FALSE, this is the p-value associated with the righthand tail
如果two.tailed=FALSE,这是p相关联的值与右边的尾巴
参数:lesser
if two.tailed=FALSE, this is the p-value associated with the lefthand tail
如果two.tailed=FALSE,这是p相关联的值与左边的尾
(作者)----------Author(s)----------
Jonathan Eastman
实例----------Examples----------
## A GENERAL EXAMPLE[#一个普通的例子]
# a comparison between two distributions[两个发行版之间的比较]
a=rnorm(n=1000, mean=1, sd=0.5)
b=rnorm(n=1000, mean=0, sd=1)
resamp.test(obs=a, exp=b, two.tailed=FALSE)
# a comparison of a single value to a normal distribution[一个单一的值到正常分布的比较]
a=3
b=rnorm(n=1000, mean=0, sd=1)
resamp.test(obs=a, exp=b, two.tailed=FALSE)
# compare above result with ecdf(), in which we compute an empirical [比较上述结果与厄立特里亚社区发展基金(),我们计算的经验]
f=ecdf(b)
print(1-f(a)) # analogous to a one-tailed test as above[与上述的单尾测试类似于]
## A COMMUNITY PHYLOGENETIC EXAMPLE[#A的社区系统发育实例]
## an example of comparing observed and expected Bst at nodes ##[比较观察值和期望值BST节点###的例子]
data(sp.example)
attach(sp.example)
s=spl
p=phy
# get nodes for a time-slice[获取一个时间片的节点]
n.t=phy.nodetimes(phy=p,time.range=c(0.25, 0.75))
# get Bsts for nodes[获得BSTS的节点]
o=spacodi.by.nodes(sp.plot=s, phy=p, obs.only=TRUE)[[1]]
obs=o[!is.na(match(o[,"node.ID"], names(n.t))),1]
# compile expected Bst-values from data reshuffling[编译预期的BST-值的数据重新洗牌]
spacodi.by.nodes(sp.plot=s, phy=p, n.rep=5, method="1s")[[2]]->exps
e=exps[!is.na(match(row.names(exps), names(n.t))),]
exp=unname(unlist(e))
# randomization test of observed and expected Bst[随机化试验观察到的和预期的BST]
resamp.test(obs=obs, exp=exp, iter=100, two.tailed=TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|