InfluentialPoints.com
Biology, images, analysis, design...
Use/Abuse Principles How To Related
"It has long been an axiom of mine that the little things are infinitely the most important" (Sherlock Holmes)

Search this site

 

 

One-way fixed effects analysis of variance - using R

Orthogonal contrasts


Gives something like this:

> modjoh=read.table('modjoh.txt') > attach(modjoh) > levels(trt) [1] "A" "B" "C" > #Define orthogonal set of contrasts > contrasts(trt)=cbind(c(0,1,-1),c(1,.5,.5)) > #Check contrasts are correct > contrasts(trt) [,1] [,2] A 0 1.0 B 1 0.5 C -1 0.5 > #Rerun model with new contrasts > joh3=aov(log(con)~trt) > summary.lm(joh3) Call: aov(formula = log(con) ~ trt) Residuals: Min 1Q Median 3Q Max -0.734847 -0.221694 -0.004491 0.195022 0.926174 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.25817 0.12681 25.693 < 2e-16 *** trt1 0.04509 0.05177 0.871 0.38747 trt2 0.57612 0.17934 3.212 0.00217 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.3274 on 57 degrees of freedom Multiple R-Squared: 0.1627, Adjusted R-squared: 0.1333 F-statistic: 5.539 on 2 and 57 DF, p-value: 0.006335 > detach("modjoh")