R语言Coplot解释

先看一下在R的官方文档中,coplots是怎么解释的

  • R Documentation
    Conditioning Plots

  • Description

This function produces two variants of the conditioning plots
discussed in the reference below.

  • Usage

coplot(formula, data, given.values, panel = points, rows, columns,
show.given = TRUE, col = par(“fg”), pch = par(“pch”),
bar.bg = c(num = gray(0.8), fac = gray(0.95)),
xlab = c(x.name, paste(“Given :”, a.name)),
ylab = c(y.name, paste(“Given :”, b.name)),
subscripts = FALSE,
axlabels = function(f) abbreviate(levels(f)),
number = 6, overlap = 0.5, xlim, ylim, …) co.intervals(x, number = 6, overlap = 0.5)

  • Arguments

formula a formula describing the form of conditioning plot. A formula
of the form y ~ x | a indicates that plots of y versus x should be
produced conditional on the variable a. A formula of the form y ~ x| a

  • b indicates that plots of y versus x should be produced conditional on the two variables a and b. All three or four variables may be
    either numeric or factors. When x or y are factors, the result is
    almost as if as.numeric() was applied, whereas for factor a or b, the
    conditioning (and its graphics if show.given is true) are adapted.

given.values a value or list of two values which determine how the conditioning on a and b is to take place. When there is no b (i.e.,
conditioning only on a), usually this is a matrix with two columns
each row of which gives an interval, to be conditioned on, but is can
also be a single vector of numbers or a set of factor levels (if the
variable being conditioned on is a factor). In this case (no b), the
result of co.intervals can be used directly as given.values argument.
panel a function(x, y, col, pch, …) which gives the action to be carried out in each panel of the display. The default is points.
rows the panels of the plot are laid out in a rows by columns array. rows gives the number of rows in the array.
columns the number of columns in the panel layout array.
show.given logical (possibly of length 2 for 2 conditioning variables): should conditioning plots be shown for the corresponding
conditioning variables (default TRUE).
col a vector of colors to be used to plot the points. If too short, the values are recycled.
pch a vector of plotting symbols or characters. If too short, the values are recycled.
bar.bg a named vector with components “num” and “fac” giving the background colors for the (shingle) bars, for numeric and factor
conditioning variables respectively.
xlab character; labels to use for the x axis and the first conditioning variable. If only one label is given, it is used for the
x axis and the default label is used for the conditioning variable.
ylab character; labels to use for the y axis and any second conditioning variable.
subscripts logical: if true the panel function is given an additional (third) argument subscripts giving the subscripts of the
data passed to that panel.
axlabels function for creating axis (tick) labels when x or y are factors.
number integer; the number of conditioning intervals, for a and b, possibly of length 2. It is only used if the corresponding
conditioning variable is not a factor.
overlap numeric < 1; the fraction of overlap of the conditioning variables, possibly of length 2 for x and y direction. When overlap <
0, there will be gaps between the data slices.
xlim the range for the x axis.
ylim the range for the y axis. … additional arguments to the panel function.
x a numeric vector.

上面的就是长长的官方文档介绍了,真的好长。。
Coplot的意思就是conditional plot
首先需要知道一个词:given 中文翻译大概相当于:条件是
这个函数也是这个意思
举个例子coplot(a~b|c, data=qq.df, …)
指的就是 examine the dependent of a and b given c in the data “qq.df”,查看a,b在给以c为条件下的关系。data也可以不用指定,它会从语境里判断是哪个数据。

其次,六个图是因为coplot函数最后运行的那句co.intervals(x, number = 6, overlap = 0.5)
number就是组数,x是因子变量(也就是上文的c),散点图按照x值分成六组,组与组之间有50%的重叠。这个可以直接通过coplot的参数given.values修改(given.value=co.intervals(x,number=6,overlap=0.7))。
六个图的顺序是左下1,左下中是2,左下右是3,左上是4以此类推。
另外,官方文档中说A formula of the form y ~ x| a * b indicates that plots of y versus x should be produced conditional on the two variables a and b. 这个我没有运行成功。。大家可以试一下。。什么时候我成功了再回来填坑。。

后面那些参数都balabala没什么用了,基本都是画图的东西。

  • 6
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值