Tt.aov: Direct estimation of 1 or 2 way anova

View source: R/Ttaov.R

Tt.aovR Documentation

Direct estimation of 1 or 2 way anova

Description

Performs the analysis of variance using the functions aov and anova. Additionally, creates a table with mean values, standard deviation and size of sample per treatment. If p>0.05, a Tukey test is also performed.

Usage

Tt.aov(vx, vtreat1, vtreat2 = NULL, p.lim = 0.05, Tuk.labs = TRUE)

Arguments

vx

dependent variable

p.lim

p-value for the limit of ANOVA to perform Tukey test

Tuk.labs

If TRUE, it will print the differences by TukeyHSD by different letters (requires package 'multcompView')

vtreat

independent variable(s). If vtreat2 exists, the function will perform a 2-way anova

Value

aov.output a list with the following objects

  1. anova : Which contains the details of the analysis

  2. stats : mean, sd, size of sample (n) and, if requested, Tukey HSD differences

  3. p : value(s) of p from anova, for a quick answer

  4. Tukey.interaction : If p>p.lim, TukeyHSD is performed. In the 2-ways anova, Tukey test will be perform for the interaction between treatments, as well as per-treatment, being 'Tukey.treatment1' and 'Tukey.treatment2' the results in the list.

Examples

data('compost')
Pb <- Tt.aov(compost$Pb, compost$Treatment, p.lim=0.001) # 1-way anova
Pb

Zn <- Tt.aov(compost$Pb,compost$Treatment,compost$Plant) # 2-way anova
Zn$anova # Results from anova
Zn$stats # Mean, SD and n values

teoten108/kgv documentation built on Sept. 22, 2022, 12:54 a.m.