Description Usage Arguments Value Note Author(s) See Also Examples
View source: R/aov.sufficient.R
Analysis of variance from sufficient statistics for groups.
For each group, we need the factor level, the response mean, the
withingroup standard deviation, and the sample size.
The correct ANOVA table is produced. The residuals are fake.
The generic vcov
and summary.lm
don't work for the
variance of the regression coefficients in this case.
Use vcovSufficient
.
1 2 3 4 5 6 
formula, data, projections, qr, contrasts, ... 
See

weights 
See

sd 
vector of withingroup standard deviations. 
object 

For aovSufficient
, an object of class c("aov", "lm").
For vcovSufficient
, a function that returns the covariance
matrix of the regression coefficients.
The residuals are fake. They are all identical and equal to the MLE
standard error (sqrt(SumSq.res/df.tot)
). They give the right
ANOVA table. They may cause confusion or warnings in other programs.
The standard errors and ttests of the coefficients are not calculated
by summary.lm
.
Using the aov
object from aovSufficient
in glht
requires the vcov.
and df
arguments.
Richard M. Heiberger <[email protected]>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40  ## This example is from Hsu and Peruggia
## This is the R version
## See ?mmc.mean for SPlus
if.R(s={},
r={
data(pulmonary)
pulmonary
pulmonary.aov < aovSufficient(FVC ~ smoker,
data=pulmonary)
summary(pulmonary.aov)
## Not run:
pulmonary.mmc < mmc(pulmonary.aov,
linfct=mcp(smoker="Tukey"),
df=pulmonary.aov$df.residual,
vcov.=vcovSufficient)
mmcplot(pulmonary.mmc, style="both")
## orthogonal contrasts
pulm.lmat < cbind("npnlmh"=c( 1, 1, 1, 1,2,2), ## not.much vs lots
"npnl" =c( 3,1,1,1, 0, 0), ## none vs light
"pnl" =c( 0, 2,1,1, 0, 0), ## {} arbitrary 2 df
"nl" =c( 0, 0, 1,1, 0, 0), ## {} for 3 types of light
"mh" =c( 0, 0, 0, 0, 1,1)) ## moderate vs heavy
dimnames(pulm.lmat)[[1]] < row.names(pulmonary)
pulm.lmat
pulmonary.mmc < mmc(pulmonary.aov,
linfct=mcp(smoker="Tukey"),
df=pulmonary.aov$df.residual,
vcov.=vcovSufficient,
focus.lmat=pulm.lmat)
mmcplot(pulmonary.mmc, style="both", type="lmat")
## End(Not run)
})

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.