supernova()

supernova()

The supernova() function will compute an analysis of variance (ANOVA) for a model, and present the statistics in a modified ANOVA table, that includes:

- sums of squares (SS)
- degrees of freedom (df)
- mean squares (MS)
- proportional reduction in error (PRE)
- F values
- p-values

For additional information, see the link below:

Idea
Example 1:

Use the supernova() function to get the ANOVA table for an empty model. You can save the model into an object first and use its name as the argument (Example 2 and Example 3), or you can use the lm() function directly in the supernova() function (Example 1).

# Generate the ANOVA table for the empty model of Thumb
# using the lm() function within the supernova() function
supernova(lm(Thumb ~ NULL, data = Fingers))

Example output:

Output of 'supernova' function with empty model

Idea
Example 2:

Use the supernova() function to get the ANOVA table for a model with a single predictor.

# Generate the ANOVA table for the Gender model of Thumb
# Save the model into an object first
gender_model <- lm(Thumb ~ Gender, data = Fingers)
supernova(gender_model)

Example output:

Output of 'supernova' function with complex model

Idea
Example 3:

Use the supernova() function to get the ANOVA table for a multivariate model.

# Generate the ANOVA table for the Gender + Height model of Thumb
gender_height_model <- lm(Thumb ~ Gender + Height, data = Fingers)
supernova(gender_height_model)

Example output:

Output of 'supernova' function with multivariate model