Questions tagged [anova]

ANOVA is an acronym for "analysis of variance". It is a widely used statistical technique to analyze the source of variance within a data set.

Overview

Although ANOVA stands for ANalysis Of VAriance, it is about comparing means of data from different groups. It is part of the general linear model which also includes linear regression and ANCOVA. In matrix algebra form, all three are:

Y=XB+e

Where Y is a vector of values for the dependent variable (these must be numeric), X is a matrix of values for the independent variables and e is error.

Tag usage

  • SO questions on ANOVA should be about implementation and programming problems, not about the statistical or theoretical properties of the technique.

  • Consider whether your question might be better suited to CrossValidated, the StackExchange site for statistics, machine learning and data analysis.

In scientific software for statistical computing and graphics, function aov implements ANOVA. Note that function anova does something else. See When should I use aov() and when anova()?

1456 questions
4
votes
1 answer

How to extract coefficients' standard error from an "aov" model

I did a aov model and I just want to extract the standard errors of each coefficient. model <- aov(Molecule ~ Comorbidity + Age + BMI + Sex, data = mydata) I can see the estimated marginal mean with: allEffects(model) But I can't extract standard…
Rosammq
  • 43
  • 1
  • 4
4
votes
1 answer

Extract data from Partial least square regression on R

I want to use the partial least squares regression to find the most representative variables to predict my data. Here is my code: library(pls) potion<-read.table("potion-insomnie.txt",header=T) potionTrain <- potion[1:182,] potionTest <-…
4
votes
0 answers

How to perform a two-way repeated measures ANOVA with missing values

For my data set, I need to perform some sort of two factor repeated measures ANOVA. I have one between-subject factor called "Treatment" and one within-subject factor called "Frequency" with 8 levels. My problem is that most of my subjects don't…
Sarah Wolf
  • 41
  • 2
4
votes
1 answer

R: function to apply Anova over different subsets of one's dataset and collect output

A common task is to have to carry out a certain statistical analysis (like an anova, glm or mixed model) on different subsets of a dataset and combine the output tables with summary coefficients and p values in a single dataframe. I am looking…
user2999576
  • 41
  • 1
  • 6
4
votes
3 answers

How to change an order of samples in Tukey's test in R?

Problem: I would like to learn how can I change an order of samples for which Tukey's test in R calculates means and assign corresponding letters. Very simple example is below. I played with iris data and have found that there are differences in…
Ilya
  • 41
  • 1
  • 3
4
votes
1 answer

ANOVA in R using summary data

is it possible to run an ANOVA in r with only means, standard deviation and n-value? Here is my data frame: q2data.mean <- c(90,85,92,100,102,106) q2data.sd <- c(9.035613,11.479667,9.760268,7.662572,9.830258,9.111457) q2data.n <-…
y3trgfhsfgr
  • 467
  • 8
  • 17
4
votes
2 answers

How to get residuals from Repeated measures ANOVA model in R

Normally from aov() you can get residuals after using summary() function on it. But how can I get residuals when I use Repeated measures ANOVA and formula is different? ## as a test, not particularly sensible statistically npk.aovE <- aov(yield ~ …
Marcin
  • 7,834
  • 8
  • 52
  • 99
4
votes
2 answers

Extracting Multivariate Tests from the output of Anova or Manova function from car package

I wonder how to extract the Multivariate Tests: Site portion from the output of fm1 in the following MWE. library(car) fm1 <- summary(Anova(lm(cbind(Al, Fe, Mg, Ca, Na) ~ Site, data=Pottery))) fm1 Type II MANOVA Tests: Sum of squares and products…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
4
votes
1 answer

Repeated-Measures ANOVA: ezANOVA vs. aov vs. lme syntax

This question is both about syntax and semantics, thus please find a (yet unanswered) duplicate on Cross-Validated: https://stats.stackexchange.com/questions/113324/repeated-measures-anova-ezanova-vs-aov-vs-lme-syntax In the machine-learning domain,…
Chris
  • 721
  • 1
  • 10
  • 23
4
votes
1 answer

effect vs. predict function

I'm simultaneously trying to understand R's predict() function and the 'effects' package effect() function. Essentially, I'm running a regression to test the interaction of two dichotomous IVs on a DV while controlling for two continuous covariates.…
YTD
  • 457
  • 3
  • 11
4
votes
1 answer

Tukey HSD for mixed continuous and categorical variables, error: "no factors"

I'm trying to run a Tukey test on mortality data, where I want to test whether mortality is influenced by the amount of copper (in an one-way ANOVA) and the combination of copper and temperature (in a two-way ANOVA). These are my formulas:…
Lundill
  • 71
  • 1
  • 1
  • 2
4
votes
1 answer

Anova table comparing groups, in R, exported to latex?

I'm mostly work with observational data, but I read a lot of experimental hard-science papers that report results in the form of anova tables, with letters indicating the significance of the differences between the groups, and then p-values of the…
generic_user
  • 3,430
  • 3
  • 32
  • 56
4
votes
1 answer

How to save the results of R statistical tests in Java

I'm working with R on my Java programs and I need to use some statistical tests, such as anova. But I don't know how to save the R results in a file to manage them later in Java. I try RCaller and rJava to join R and Java, but I think the problem is…
4
votes
3 answers

To get grouped results in R

Here I have like below data set. In SAS system, to get grouped results in whatever I do such as means, GLM or REG, I can cord as: proc sort; by B; proc glm; class A; model C=A; by B; run; Then, I can get GLM results within or by B level. But, I DO…
4
votes
1 answer

parametric ANOVA with unequal variances

I was wondering if there is a way in R to do an ANOVA with unequal variances? Imagine the following example: x <- c(10,11,15,8,16,12,20) y <- c(10,14,18,25,28,30,35) d <- c(x,y) f <- as.factor(c(rep("a",7), rep("b",7))) # Unequal…
user969113
  • 2,349
  • 10
  • 44
  • 51