Ggplot2 scatter plot with regression7/23/2023 Residual standard error: 2.796 on 35 degrees of freedom Since we know that class “moderates” the effect between iq and grades, let’s “control” for class by adding class into the model specification. Note the significant negative relationship between iq and grades. Summaryh(model_linear) # generates APA-formmatted results (requires hausekeep package)ġ: (Intercept) b = 125.14, SE = 4.24, t(38) = 29.52, p <. Residual standard error: 8.599 on 38 degrees of freedom Use ggplot function (not ggplot2, which is the name of the library, not a function!). Layer 1: specify data object, axes, and grouping variables Note: ggplot prefers long-form (tidy) data. The first line is the first/bottom-most layer, and second line is on top of the bottom layer, and third line is on top of the second layer, and the last line of code is the top-most layer. Ggplot2 produces figures by adding layers one at a time. It takes me many hours to research, learn, and put together tutorials. Consider being a patron and supporting my work?ĭonate and become a patron: If you find value in what I do and have learned something from my site, please consider becoming a patron. Get source code for this RMarkdown script here.
0 Comments
Leave a Reply. |