Description Usage Arguments Value Author(s) Examples
View source: R/plot.simpleRslopes.R View source: R/methods.R
Plot method for simple_slopes
1 2 |
x |
|
one_plot |
Boolean.
Should one plot be printed?
Defaults to |
... |
Additional arguments. No additional arguments available at this time |
Returns a list containing each plot for the simple slopes
Alexander Christensen <alexpaulchristensen@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Generate data
df <- data.frame(
y = rnorm(100),
x1 = rnorm(100),
x2 = rnorm(100)
)
# Estimate linear model
fit <- lm(y ~ x1 * x2, data = df)
# Estimate simple slopes
result <- simple_slopes(
fit = fit,
variable1name = "x1", # must be name as it appears in 'fit' object
variable2name = "x2", # must be name as it appears in 'fit' object
plot = FALSE # only FALSE for CRAN checks
)
# Plot simple slopes
plot(result)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.