plot-methods(simFrame)
plot-methods()所属R语言包:simFrame
Plot simulation results
图模拟结果
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Plot simulation results. A suitable plot function is selected automatically, depending on the structure of the results.
图的模拟结果。一种合适的plot函数自动选择的,这取决于结构的结果。
用法----------Usage----------
## S4 method for signature 'SimResults,missing'
plot(x, y , ...)
参数----------Arguments----------
参数:x
the simulation results.
的仿真结果。
参数:y
not used.
不被使用。
参数:...
further arguments to be passed to the selected plot function.
进一步的参数被传递到选定的绘图功能。
值----------Value----------
An object of class "trellis". The update method can be used to update components of the object and the print method (usually called by default) will plot it on an appropriate plotting device.
对象的类"trellis"。 update方法可以用来更新组件的对象和print方法(通常称为默认情况下),将绘制在一个适当的绘图装置。
Details
详细信息----------Details----------
The results of simulation experiments with at most one contamination level and at most one missing value rate are visualized by (conditional) box-and-whisker plots. For simulations involving different contamination levels or missing value rates, the average results are plotted against the contamination levels or missing value rates.
(有条件的)箱须图在最污染程度和最缺少一个价值率的模拟实验结果的可视化。对于涉及到不同的污染程度或遗漏值的模拟,暗算的污染程度或遗漏值的平均结果。
方法----------Methods----------
x = "SimResults", y = "missing" plot simulation results.
x = "SimResults", y = "missing"积仿真结果。
(作者)----------Author(s)----------
Andreas Alfons
参考文献----------References----------
Statistical Simulation: The R Package <code>simFrame</code>. Journal of Statistical Software, 37(3), 1–36. URL http://www.jstatsoft.org/v37/i03/.
参见----------See Also----------
simBwplot, simDensityplot, simXyplot, "SimResults"
simBwplot,simDensityplot,simXyplot,"SimResults"
实例----------Examples----------
#### design-based simulation[###设计为基础的模拟]
set.seed(12345) # for reproducibility[可重复性]
data(eusilcP) # load data[加载数据]
## control objects for sampling and contamination[#控制对象的采样和污染]
sc <- SampleControl(size = 500, k = 50)
cc <- DARContControl(target = "eqIncome", epsilon = 0.02,
fun = function(x) x * 25)
## function for simulation runs[功能模拟运行]
sim <- function(x) {
c(mean = mean(x$eqIncome), trimmed = mean(x$eqIncome, 0.02))
}
## run simulation[#运行仿真]
results <- runSimulation(eusilcP,
sc, contControl = cc, fun = sim)
## plot results[#图谋结果的]
tv <- mean(eusilcP$eqIncome) # true population mean[真正的人口是什么意思]
plot(results, true = tv)
#### model-based simulation[###基于模型的仿真]
set.seed(12345) # for reproducibility[可重复性]
## function for generating data[#,用于产生数据的功能]
rgnorm <- function(n, means) {
group <- sample(1:2, n, replace=TRUE)
data.frame(group=group, value=rnorm(n) + means[group])
}
## control objects for data generation and contamination[#控制对象的数据生成和污染]
means <- c(0, 0.25)
dc <- DataControl(size = 500, distribution = rgnorm,
dots = list(means = means))
cc <- DCARContControl(target = "value",
epsilon = 0.02, dots = list(mean = 15))
## function for simulation runs[功能模拟运行]
sim <- function(x) {
c(mean = mean(x$value),
trimmed = mean(x$value, trim = 0.02),
median = median(x$value))
}
## run simulation[#运行仿真]
results <- runSimulation(dc, nrep = 50,
contControl = cc, design = "group", fun = sim)
## plot results[#图谋结果的]
plot(results, true = means)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|