The gf_lm() function overlays the best-fitting regression line on a scatter plot when chained onto gf_point(). Example: # adds a regression line gf_point(Thumb ~ Height, data = Fingers) %>% gf_lm( color = "orange", size = 2 )
The predict() function will generate the prediction(s) from a model. Example 1: # Calculate the predictions from the Sex model of Thumb # Use the lm() function to specify the model predict(lm(Thumb ~ Sex, data = Fingers)) # Alt: Save the model into ...
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 ...
The anova() function will compute an analysis of variance (ANOVA) for a model, and present the statistics in an ANOVA table, that includes: - sums of squares (Sum Sq) - degrees of freedom (Df) - mean squares (Mean Sq) - F values - p-values (Pr(>F)) ...
The confint() function computes confidence intervals (based on the t-distribution) for one or more parameters in a fitted model. The default confidence level is 95%. To adjust the confidence level, use the "level = " argument. Example 1: You can use ...