anova

Efficient algorithm for detecting different elements in a collection

Imagine you have a set of five elements (A-E) with some numeric values of a measured property (several observations for each element): A = {100, 110, 120, 130} B = {110, 100, 110, 120, 90} C = { 90, 110, 120, 100} D = {120, 100, 120, 110, 110, 120} E = {110, 120, 120, 110, 120} First, I have to detect if there are significant differen...

ANOVA with 3 fixed factors in R

Im trying to run a model with a response variable p and 3 fixed factors to get ANOVA. this is how my code looks like : #run it as 3 fixed factor model p1=c(37,38,37,41,41,40,41,42,41) p2=c(42,41,43,42,42,42,43,42,43) p3=c(30,31,31,31,31,31,29,30,28) p4=c(42,43,42,43,43,43,42,42,42) p5=c(28,30,29,29,30,29,31,29,29) p6=c(42,42,43,45,45...

aov define F values computation

Greetings to all This is my model: aov.fit<-aov(Y~A+B+C+D+E+A:C+A:E, data=dat) In summary(aov.fit) all F values are computed by eg MS(A)/MS(Residuals). This is not correct (or what I want), except for F(B) and F(A:E). I suppose P values are not correct either. Can I specify how the F computations will be done? I 'd like them to be lik...

2-way anova on unbalanced dataset

Is aov appropriate for unbalanced datasets. According to help ...provides a wrapper to lm for fitting linear models to balanced or unbalanced experimental designs. But later on it says aov is designed for balanced designs, and the results can be hard to interpret without balance. How should I perform a 2-way anova on an unbalanced datas...

Power Analysis in [R] for Two-Way Anova

I am trying to calculate the necessary sample size for a 2x2 factorial design. I have two questions. 1) I am using the package pwr and the one way anova function to calculate the necessary sample size using the following code pwr.anova.test(k = , n = , f = , sig.level = , power = ) However, I would like to look at two way anova, si...

Homoscedascity test for Two-Way ANOVA

I've been using var.test and bartlett.test to check basic ANOVA assumptions, among others, homoscedascity (homogeniety, equality of variances). Procedure is quite simple for One-Way ANOVA: bartlett.test(x ~ g) # where x is numeric, and g is a factor var.test(x ~ g) But, for 2x2 tables, i.e. Two-Way ANOVA's, I want to do something lik...

Extract p-value from aov

I am looking to extract the p-value generated from an anova in R. Here is what I am running: test <- aov(asq[,9] ~ asq[,187]) summary(test) Yields: Df Sum Sq Mean Sq F value Pr(>F) asq[, 187] 1 3.02 3.01951 12.333 0.0004599 *** Residuals 1335 326.85 0.24483 --- Signif. codes: 0 ...