user10001876
user10001876

Reputation:

Why are pvalue, fvalue and residuals not being displayed in this two way anova in R?

I tried to perform a 2 way anova for the lung data set.However, as you can see below, I am only receiving DF,Sum sq and Mean sq in the output and no data is displayed on residuals, pvalue and fvalue.

Kindly help me with this. Earnestly,

summary(aov(volume~ method+subject+ method*subject))
summary(aov(volume~(method)+(subject)+(method)*(subject)))

Output:

> summary(aov(volume~(method)+(subject)+(method)*(subject)))
               Df Sum Sq Mean Sq
method          2 1.0811  0.5406
subject         5 2.1828  0.4366
method:subject 10 0.8322  0.0832

Upvotes: 1

Views: 528

Answers (1)

Simon
Simon

Reputation: 10150

The answer is found in the docs for the summary aov function:

For fits with a single stratum the result will be a list of ANOVA tables, one for each response (even if there is only one response): the tables are of class "anova" inheriting from class "data.frame". They have columns "Df", "Sum Sq", "Mean Sq", as well as "F value" and "Pr(>F)" if there are non-zero residual degrees of freedom.

In your case you have a fully saturated model. In terms of degrees of freedom, your model is using up 18 (1 for the model, 2 for the method factor, 5 for subject, and 10 for the interaction). Given you only have 18 rows of data, you have no residual degrees of freedom to actually test the model hypothesis

What you need to do is either get more data, or simplify the model (for example, remove the interaction)

Upvotes: 5

Related Questions