# aovSufficient

From HH v2.3-42
0th

Percentile

##### Analysis of variance from sufficient statistics for groups.

Analysis of variance from sufficient statistics for groups. For each group, we need the factor level, the response mean, the within-group 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.

Keywords
htest
##### Usage
aovSufficient(formula, data = NULL,
projections = FALSE, qr = TRUE, contrasts = NULL,
weights = data$n, sd = data$s,
...)vcovSufficient(object, ...)
##### Arguments
formula, data, projections, qr, contrasts, ...
See#ifndef S-Plus aov. #endif #ifdef S-Plus aov. #endif
weights
See#ifndef S-Plus lm. #endif #ifdef S-Plus lm. #endif
sd
vector of within-group standard deviations.
object
"aov" object constructed by aovSufficient. It also works with regular aov objects.
##### Value

• For aovSufficient, an object of class c("aov", "lm"). For vcovSufficient, a function that returns the covariance matrix of the regression coefficients.

##### Note

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 t-tests of the coefficients are not calculated by summary.lm. Using the aov object from aovSufficient in glht requires the vcov. and df arguments.

MMC and#ifndef S-Plus aov. #endif #ifdef S-Plus aov. #endif

##### Aliases
• aovSufficient
• vcovSufficient
##### Examples
## This example is from Hsu and Peruggia

## This is the R version
## See ?mmc.mean for S-Plus

if.R(s={},
r={

data(pulmonary)
pulmonary
pulmonary.aov <- aovSufficient(FVC ~ smoker,
data=pulmonary)
summary(pulmonary.aov)

pulmonary.mmc <- mmc(pulmonary.aov,
linfct=mcp(smoker="Tukey"),
df=pulmonary.aov$df.residual, vcov.=vcovSufficient) old.omd <- par(omd=c(.0,.95,0,1)) plot(pulmonary.mmc, ry=c(2.5, 3.4), x.offset=.05) ## tiebreaker plot, with contrasts ordered to match MMC plot, ## with all contrasts forced positive and with names also reversed, ## and with matched x-scale. plotMatchMMC(pulmonary.mmc$mca)

## orthogonal contrasts
pulm.lmat <- cbind("npnl-mh"=c( 1, 1, 1, 1,-2,-2), ## not.much vs lots
"n-pnl"  =c( 3,-1,-1,-1, 0, 0), ## none vs light
"p-nl"   =c( 0, 2,-1,-1, 0, 0), ## {} arbitrary 2 df
"n-l"    =c( 0, 0, 1,-1, 0, 0), ## {} for 3 types of light
"m-h"    =c( 0, 0, 0, 0, 1,-1)) ## moderate vs heavy
dimnames(pulm.lmat)[] <- 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) plot(pulmonary.mmc, ry=c(2.5, 3.4), x.offset=.05) plotMatchMMC(pulmonary.mmc$lmat, col.signif='blue')

## pairwise and orthogonal contrasts on the same plot
plot(pulmonary.mmc, ry=c(2.5, 3.4), x.offset=.05,
print.mca=TRUE, print.lmat=TRUE)
par(old.omd)
})
Documentation reproduced from package HH, version 2.3-42, License: GPL (>= 2)

### Community examples

Looks like there are no examples yet.