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
-1
votes
1 answer

Combined Boxplots in R

I want to draw the same exact graph in R. However, I want to consider two options: (1) with one x axis for each of the genders & (2) two different xaxes for each of the gender. Here is also the link for where I found the image:…
MK25
  • 11
  • 4
-1
votes
1 answer

Dunnett Test with two different factors in R

I am trying to conduct Dunnett test. I have two different factors: 1) group, 2) condition I can run the code with one factor using this code Dunnett <- glht(anova_growth, linfct = mcp(group= "Dunnett")) summary(Dunnett) However I…
mervet
  • 11
  • 1
-1
votes
1 answer

Hypothesis testing with ANOVA in R

I have a dataset of the following form. Rows: 110 Columns: 11 $ ID 1, 2, 3, 4, 5, 6, 7, 8, 9,… $ happy_experimental 546.32, 549.03, 596.21, 46… $ happy_control 504.87, 314.97, 539.73, 43… $…
Aashiq Reza
  • 153
  • 2
  • 13
-1
votes
1 answer

Hypothesis testing for three groups

Based on the data, is the average sale amount statistically the same for the A, B, and C groups? I performed t.test on AB, BC, CA. for CA, p-value>0.05, so I concluded for CA, we can't reject null hypothesis, and average may be same. H1- alternative…
anjali
  • 9
  • 2
-1
votes
1 answer

Python: ANOVA with dictionaries of different lengths

I have the following data: data = {'treatment_1': [80, 0, 0, 8], 'treatment_2': [78, 62], 'treatment_3': [85, 62, 10, 3, 18, 18, 98, 71, 78, 12, 52, 39, 24, 13], 'treatment_4': [78, 33, 78, 40, 47, 32] } I am trying…
-1
votes
1 answer

Parsing and using a string as an argument in a plot inside a user-defined function

I´m trying to build a function which would receive: a dataframe (data), variable(s) to group by (groupby), and the name of a dependent variable (var); The function will then: a. create a plot of the means of var, separated by group(s) in groupby. In…
guy
  • 23
  • 3
-1
votes
3 answers

Receiving an error when using aov() inside a function

I am trying to use the aov() function inside a function but R keeps giving me the same error. Code: dat$X1 = rep(c("a", "b"), 2) dat$X2 = c(1,2,3,4) f = function (x){ aov(x ~ X1 , data = dat) } f('X2') This gives me the following error: Error in…
mvel
  • 1
  • 1
-1
votes
1 answer

How to filter a list of models based on Pr(>F)

I ran a model which is basically this models <- mclapply(frms, function(x) anova(lm(x, data = mrna.pcs))) Now I want to filter the model based on the Pr(>F) The model class is list This the str of the model str(models) List of 248 $ PC1 ~ Sex …
PesKchan
  • 868
  • 6
  • 14
-1
votes
1 answer

No applicable method for 'summarise' applied to an object of class "ts"

install.packages(c("ggplot2", "ggpubr", "tidyverse", "broom", "AICcmodavg")) library(ggplot2) library(ggpubr) library(tidyverse) library(broom) library(AICcmodavg) my_data <- read.table(file = "clipboard", sep…
-1
votes
1 answer

ANOVA test for three means

I am trying use ANOVA test for this question: practice I've created three vectors and I am wondering how to run ANOVA for all 3. If I write first = c(30000, 34000, 36000, 38000, 40000) third = c(30000, 35000, 37000, 38000, 40000) fifth = c(40000,…
user17402153
-1
votes
1 answer

normally distributed population, calculating in R the probability of negative or zero readings occurring

In R, how do you calculate the probability of negative or zero readings occurring? μ and σ are giving.
Mara
  • 1
-1
votes
1 answer

Two-way repeated measures ANOVA in R

I have been trying to do a two-way repeated measures ANOVA in R on a fictional data set to learn statistics. I have asked this question before, but I had to adapt my data sets because I had made some crucial mistakes. It represents two students who…
-1
votes
1 answer

Post hoc three-way interaction ANOVA

I performed a 2x2x2 three-way ANOVA and the three-way interaction term was significant. I understand this to mean that one (or more) two-way interactions operate differently in the presence of the third variable. How do I perform a post hoc test(s)…
Quinn
  • 59
  • 6
-1
votes
1 answer

ANOVA degrees of freedom is incorrect

The results of my ANOVA are as follows, mnn=aov(gy~gen+rep, data=my) summary(mnn) Df Sum Sq Mean Sq F value Pr(>F) gen 6 1923.1 320.5 31.206 5.42e-07 *** rep 1 7.1 7.1 0.695 0.419 Residuals 13…
Nad Pat
  • 3,129
  • 3
  • 10
  • 20
-1
votes
1 answer

How to put F-statistic and P-value into a table?

How do I simplify these codes into a for-loop and create a table to display the F-statistics and P-value of the features. print(scipystats.f_oneway(df_data.loc[df_data["SaleCondition"] == 'Normal'].SalePrice, …
takahashi
  • 21
  • 1
  • 7