compresid2way(sfsmisc)
compresid2way()所属R语言包:sfsmisc
Plot Components + Residuals for Two Factors
图组件+残值的两个因素
译者:生物统计家园网 机器人LoveR
描述----------Description----------
For an analysis of variance or regression with (at least) two factors: Plot components + residuals for two factors according to Tukey's “forget-it plot”. Try it!
(至少)两个因素:图组件+残差根据Tukey的“忘记它的图”两个因素方差分析或回归。试试吧!
用法----------Usage----------
compresid2way(aov, data=NULL, fac=1:2, label = TRUE, numlabel = FALSE,
xlab=NULL, ylab=NULL, main=NULL,
col=c(2,3,4,4), lty=c(1,1,2,4), pch=c(1,2))
参数----------Arguments----------
参数:aov
either an aov object with a formula of the form y ~ a + b, where a and b are factors, or such a formula.
要么是aov对象与公式的形式y ~ a + b,其中a和b的因素,或者这样一个公式。
参数:data
data frame containing a and b.
数据框包含a和b。
参数:fac
the two factors used for plotting. Either column numbers or names for argument data.
的用于绘制两个因素。任一列数字或名称参数data。
参数:label
logical indicating if levels of factors should be shown in the plot.
逻辑层次的因素,应在图中所示。
参数:numlabel
logical indicating if effects of factors will be shown in the plot.
逻辑因素的影响将在图中所示。
参数:xlab,ylab,main
the usual title components, here with a non-trivial default constructed from aov and the component factors used.
通常是title组成部分,在这里,一个不平凡的默认构造aov和组件因素。
参数:col,lty,pch
colors, line types, plotting characters to be used for plotting [1] positive residuals, [2] negative residuals, [3] grid, [4] labels. If pch is sufficiently long, it will be used as the list of individual symbols for plotting the y values.
颜色,线的类型,要用于绘制[1 [2]正残差,]负面残差,[3]网格,[4]标签绘制字符。如果pch足够长时,它会被用作各个符号的列表,用于绘制的y值。
Details
详细信息----------Details----------
For a two-way analysis of variance, the plot shows the additive components of the fits for the two factors by the intersections of a grid, along with the residuals. The observed values of the target variable are identical to the vertical coordinate.
对于双向方差分析,该图显示的是添加剂组分的配合的两个因素的一个网格的交叉点,沿与残差。所观察到的目标变量的值是相同的垂直坐标。
The application of the function has been extended to cover more complicated models. The components of the fit for two factors are shown as just described, and the residuals are added. The result is a “component plus residual” plot for two factors in one display.
应用程序的功能已经扩展到更复杂的模型。组件适合于两个因素中示如刚才所述的,并已加入残差。其结果是一个“组件加上残余”积在一个显示的两个因素。
值----------Value----------
Invisibly, a list with components
不可见的,与组件的列表
参数:compy
data.frame containing the component effects of the two factors, and combined effects plus residual
数据框包含的组件的两个因素的影响,及联合作用加上剩余的
参数:coef
coefficients: Intercept and effects of the factors
系数:截取和效果的因素
(作者)----------Author(s)----------
Werner Stahel <a href="mailto:stahel@stat.math.ethz.ch">stahel@stat.math.ethz.ch</a>
参考文献----------References----------
Data Analysis and Regression: A Second Course in Statistics. Addison-Wesley, Reading, Mass., p. 176.
Exploratory Data Analysis. Addison-Wesley, Reading, Mass., p. 381.
参见----------See Also----------
interaction.plot
interaction.plot
实例----------Examples----------
## From Venables and Ripley (2002) p.165.[#,从维纳布尔斯和里普利(2002年)第165页。]
N <- c(0,1,0,1,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,0)
P <- c(1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0)
K <- c(1,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,0,1,1,1,0,1,0)
yield <- c(49.5,62.8,46.8,57.0,59.8,58.5,55.5,56.0,62.8,55.8,69.5,55.0,
62.0,48.8,45.5,44.2,52.0,51.5,49.8,48.8,57.2,59.0,53.2,56.0)
npk <- data.frame(block=gl(6,4), N=factor(N), P=factor(P),
K=factor(K), yield=yield)
npk.cr <- compresid2way(yield ~ N+P+K, data=npk, fac=c("P","K"))
## Fisher's 1926 data on potatoe yield[#费舍尔的1926年数据potatoe产量]
data(potatoes)
pot.aov <- aov(yield ~ nitrogen+potash+pos, data=potatoes)
compresid2way(pot.aov, pch=as.character(potatoes$pos))
compresid2way(yield~nitrogen+potash, data=subset(potatoes, pos == 2))
## 2 x 3 design :[#2×3设计:]
data(warpbreaks)
summary(fm1 <- aov(breaks ~ wool + tension, data = warpbreaks))
compresid2way(fm1)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|