全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
8956 5
2015-03-14
我想问下在aov具体的模型变量中可以用Error()表示,这是什么含义,比如给的例子里有
npk.aovE <- aov(yield ~  N*P*K + Error(block), npk)
npk.aovE
summary(npk.aovE)
options(op)  # reset to previous

这里的Error()是什么意思?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-3-14 21:37:07
帮助里面只简单解释一点啊
不明白
看看哪位能解释一下

aov {stats}

R Documentation

Fit an Analysis of Variance Model

Description

Fit an analysis of variance model by a call to lm for each stratum.

Usage

aov(formula, data = NULL, projections = FALSE, qr = TRUE,

    contrasts = NULL, ...)

Arguments

formula

A formula specifying the model.

data

A data frame in which the variables specified in the formula will be found. If missing, the variables are searched for in the standard way.

projections

Logical flag: should the projections be returned?

qr

Logical flag: should the QR decomposition be returned?

contrasts

A list of contrasts to be used for some of the factors in the formula. These are not used for any Error term, and supplying contrasts for factors only in the Error term will give a warning.

...

Arguments to be passed to lm, such as subset or na.action. See ‘Details’ about weights.

Details

This provides a wrapper to lm for fitting linear models to balanced or unbalanced experimental designs.

The main difference from lm is in the way print, summary and so on handle the fit: this is expressed in the traditional language of the analysis of variance rather than that of linear models.

If the formula contains a single Error term, this is used to specify error strata, and appropriate models are fitted within each error stratum.

The formula can specify multiple responses.

Weights can be specified by a weights argument, but should not be used with an Error term, and are incompletely supported (e.g., not by model.tables).

Value

An object of class c("aov", "lm") or for multiple responses of class c("maov", "aov", "mlm", "lm") or for multiple error strata of class "aovlist". There are print and summary methods available for these.

Note

aov is designed for balanced designs, and the results can be hard to interpret without balance: beware that missing values in the response(s) will likely lose the balance. If there are two or more error strata, the methods used are statistically inefficient without balance, and it may be better to use lme in package nlme.


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-3-30 17:12:42
参数:formula
A formula specifying the model.
指定的模型公式。

参数:data
A data frame in which the variables specified in the formula will be found. If missing, the variables are searched for in the standard way.
一个数据框,在该公式中指定的变量会被发现。如果缺少,变量为标准的方式进行搜索。

参数:projections
Logical flag: should the projections be returned
逻辑标志:应被退回的预测

参数:qr
Logical flag: should the QR decomposition be returned
逻辑标志:应返回QR分解

参数:contrasts
A list of contrasts to be used for some of the factors in the formula. These are not used for any Error term, and supplying contrasts for factors only in the Error term will give a warning.
公式中的一些因素的对比列表。这些都不给任何Error,只有在Error时才给予警告。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-5-22 19:40:50
楼主知道什么意思了吗?我遇到同样的问题了,我感觉3楼翻译的不对。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-5-22 19:55:21
楼主我知道什么意思了,这是使用aov方程做分析所要求的公式形式。
以下为引用:
在重复测量的方差分析中,实验对象被测量多次,所以会存在组内因子,组内因子要以下面的形式特别标明出来,其中B是组间因子,W是组内因子,subject是实验对象的ID,
model=aov(Y ~ B * W + Error(Subject/W))
上述方法的前提是对应组内因子不同水平的数据是等方差的,当传统方法的假设得不到满足时,则应用lme4包中lmer函数,利用混合效应模型来解决问题。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-6-28 19:18:39
fisk_all_star 发表于 2015-5-22 19:55
楼主我知道什么意思了,这是使用aov方程做分析所要求的公式形式。
以下为引用:
在重复测量的方差分析中, ...
好的,谢谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群