找回密码
 注册
查看: 328|回复: 0

R语言 separationplot包 separationplot()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 01:09:38 | 显示全部楼层 |阅读模式
separationplot(separationplot)
separationplot()所属R语言包:separationplot

                                        Generate a Separation Plot
                                         生成一个分离图

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

This is the core function for the generation of a separation plot.
这是核心功能的分离图的产生。


用法----------Usage----------


separationplot(pred, actual, type = "line", line = T, lwd1 = 0.5, lwd2 = 0.5, heading = "",  xlab = "", shuffle = T, width = 9, height = 1.2, col0 = "#FEF0D9", col1 = "#E34A33", flag = NULL, flagcol = 1, file = NULL, newplot = T, locate = NULL, rectborder = NA, show.expected = F, zerosfirst = T, BW=F)



参数----------Arguments----------

参数:pred
Vector of predicted probabilities (on a continuous 0 to 1 scale).
向量的预测概率(在连续的0到1刻度)。


参数:actual
Vector of actual outcomes (each element must be either 0 or 1).
向量的实际结果(每个元素必须是0或1)。


参数:type
Should the individual lines on the separation plot be plotted as line segments (type="line") or rectangles (type="rect"), or should the probabilities in different regions of the plot be grouped into distinct bands (type="bands")?
如果个别线路的分离图绘制线段(type="line")或矩形(type="rect"),或在不同区域的图的概率进行分组到不同的频段(type="bands" )?


参数:line
Should a trace line be added to the plot?
如果迹线的图吗?


参数:lwd1
The width of the individual line segments (only when type="line").
的各个线段的宽度(只有当type="line")。


参数:lwd2
The width of the trace line (only when line=T).
迹线的宽度(只有当line=T)。


参数:heading
An optional title for the plot.
一个可选的标题的图。


参数:xlab
An option x-axis label.
x轴的选项标签。


参数:shuffle
If shuffle=T, the order of rows in the results data is randomized to break up any pre-existing patterns that may distort the appearance of the results in the special case where many of the observations share the same fitted values.  This happens, for example, when the original dataframe is organized in such a way that all the cases with the event of interest come before the cases without the event.  Note that when shuffle=T, the random number seed is reset to 1 each time this function is called.  This ensures that replicable results can be obtained even when the order of observations is randomized.
如果shuffle=T,结果数据中的行的顺序是随机的,打破了任何预先存在的模式,在特殊情况下,其中的许多意见,共享相同的拟合值的结果可能会扭曲的外观。会发生这种情况,例如,当原来的数据框是在这样一种方式,所有的情况下与感兴趣的事件的事件前的情况下,未经组织。需要注意的是,当shuffle=T,随机数种子重置为1调用此功能时。这确保可重复的结果,可以得到即使在观测值的顺序是随机的。


参数:width
Width of the plot space (in inches).
的图空间的宽度(以英寸为单位)。


参数:height
Height of the plot space (in inches).
的图空间的高度(以英寸为单位)。


参数:col0
Color of the predicted probabilities corresponding to 0s in the actual vector.  The default color has been chosen from one of the palettes on http://colorbrewer2.org/.
0actual矢量预测的概率相应的颜色。已被选定的默认颜色从一个调色板http://colorbrewer2.org/。


参数:col1
Color of the predicted probabilities corresponding to 1s in the actual vector.  The default color has been chosen from one of the palettes on http://colorbrewer2.org/.
颜色中的“1”actual矢量对应的预测概率。已被选定的默认颜色从一个调色板http://colorbrewer2.org/。


参数:flag
A vector of row number(s) in the actual vector corresponding to the observations to flag.
一个向量的行数(S)actual矢量观测的标志对应。


参数:flagcol
A vector of colors for the flags.
一个向量的国旗的颜色。


参数:file
The name and file path of where the pdf output should be written, if desired. If file=NULL the output will be written to the screen.
名和文件路径的PDF输出,如果需要的话,应该写。如果file=NULL输出将被写入到屏幕上。


参数:newplot
Should a new plotting space be opened up for the separation plot?  Select newplot=F if you want the separation plot to be added to currently open output device.
应该打开一个新的绘图空间的分离图?选择newplot=F如果你想分离图被添加到当前打开的输出设备。


参数:locate
Number of lines (if any) on the separation plot that you want to identify with the mouse using the locator function.
行数(如果有的话)上的的分离图,你要确定用鼠标locator使用函数。


参数:rectborder
When type="rect", the value of this argument is passed to the border argument of the rect function used to draw the line segments.  The default setting (rectborder=NA) suppresses the drawing of borders around the individual segments of the plot.
当type="rect",这种说法的价值传递给border参数的rect函数用于绘制线段。默认设置(rectborder=NA)抑制周围的边界各段的图绘制。


参数:show.expected
If show.expected=T, a marker is added to the plot showing the expected total number of events.  The expected number of events is calculated by simply summing (and rounding) the predicted probabilities over all observations.
如果show.expected=T,一个标记被添加到示出了预期的事件总数的图。预期的事件数的计算方法是简单地总结(四舍五入)的所有观测的预测概率。


参数:zerosfirst
When type="line", should the 0s be plotted in the background, and the 1s in the foreground, or vice-versa?  This will affect the output when the number of observations is very large relative to the size of the plot.
当type="line",应在0绘制的背景下,前景中的“1”,或反之亦然?这将影响到输出时的若干意见是非常大的相对大小的图。


参数:BW
Should the Black and White color scheme be implemented?
如果黑色和白色的配色方案来实现呢?


Details

详细信息----------Details----------


值----------Value----------

<table summary="R valueblock"> <tr valign="top"><td>resultsmatrix </td> <td> The dataframe containing the data used to generate the separation plot.  The first column is the vector of predicted probabilities, the second is the vector of actual outcomes, the third indicates which observations have been flagged using the flag argument above, the fourth gives the position of each observation on the horizontal axis of the separation plot, and the fifth gives the color used to plot each observation. </td></tr> </table>
<table summary="R valueblock"> <tr valign="top"> <TD>resultsmatrix </ TD> <TD>数据框包含的数据用于生成的分离图。第一列是向量的预测概率,第二个是向量的实际结果,其中观测已被标记的使用第三指明flag的上述论点,第四给每个观测值的位置上的水平轴分离图,以及第五,给出了所使用的颜色来绘制每个观察。 </ TD> </ TR> </ TABLE>


注意----------Note----------


(作者)----------Author(s)----------



Brian Greenhill &lt;<a href="mailto:brian.d.greenhill@dartmouth.edu">brian.d.greenhill@dartmouth.edu</a>&gt;



参考文献----------References----------



参见----------See Also----------


实例----------Examples----------




# Create a separation plot for a simple logit model:[创建一个简单的Logit模型的分离图:]

library(MASS)
set.seed(1)
Sigma <- matrix(c(1,0.78,0.78,1),2,2)
a<-(mvrnorm(n=500, rep(0, 2), Sigma))
a[,2][a[,2]>0.75]<-1
a[,2][a[,2]<=0.75]<-0
a[,1]<-a[,1]-min(a[,1])
a[,1]<-a[,1]/max(a[,1])

cor(a) # should be 0.55[应为0.55]

model1<-glm(a[,2]~a[,1], family=binomial(link = "logit"))

library(Hmisc)
somers2(model1$fitted.values, model1$y)

separationplot(pred=model1$fitted.values, actual=model1$y, type="rect", line=TRUE, show.expected=TRUE, heading="Example 1")




转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-5-20 00:33 , Processed in 0.023318 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表