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:

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

Example 2:

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

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

Example output:

Output of 'supernova' function with complex model

Example 3:

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

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

Example output:

Output of 'supernova' function with multivariate model