slope.diff | R Documentation |
Measuring the difference between slopes in angles
slope.diff(slope1, slope2, angle = "degree", significance)
slope1 |
A slope. |
slope2 |
Another slope. |
angle |
Either |
significance |
Optional, an angle value below which angles are not significant (in degree or radian) |
Either the value of the angle (if significance
is left empty) or a logical
whether the angle is below the significance
value.
Thomas Guillerme and Ariel Marcy
## A random dataset
data <- as.data.frame(replicate(3, rnorm(10)))
colnames(data) <- letters[1:3]
## Two slopes
slope_b <- lm(a ~ b, data)$coefficients[["b"]]
slope_c <- lm(a ~ c, data)$coefficients[["c"]]
## The slope difference
slope.diff(slope_b, slope_c)
## The slope difference in radian
slope.diff(slope_b, slope_c, angle = "radian")
## Whether the slope difference is lower than 4.5 degrees
slope.diff(slope_b, slope_c, significance = 4.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.