ggEffect {ggiraphExtra} | R Documentation |
Visualize the effect of interaction between two continuous independent variables on a response variable
Description
Visualize the effect of interaction between two continuous independent variables on a response variable
Usage
ggEffect(x, ...)
## Default S3 method:
ggEffect(x, mapping, use.label = TRUE, use.labels = TRUE, ...)
## S3 method for class 'formula'
ggEffect(x, data, ...)
## S3 method for class 'lm'
ggEffect(
x,
no = 1,
probs = c(0.1, 0.5, 0.9),
point = TRUE,
xvalue = NULL,
digits = 2,
use.rownames = FALSE,
interactive = FALSE,
...
)
Arguments
x |
Object to ggEffect |
... |
additional arguments passed to the generic function |
mapping |
Set of aesthetic mappings created by aes or aes_. |
use.label |
Logical. Whether or not use column label in case of labelled data |
use.labels |
Logical. Whether or not use value labels in case of labelled data |
data |
A data.frame |
no |
an integer |
probs |
A vector of probability weights for obtaining the elements of the vector being sampled.Default value is c(0.10,0.5,0.90) |
point |
A logical value. If TRUE, draw points |
xvalue |
A numeric vector |
digits |
An integer indicating the number of decimal places |
use.rownames |
If TRUE, use rownames in label |
interactive |
A logical value. If TRUE, an interactive plot will be returned |
Value
An interactive plot showing interaction
Methods (by class)
-
default
: Visualize the effect of interaction between two continuous independent variables on a response variable -
formula
: Visualize the effect of interaction between two continuous independent variables on a response variable -
lm
: Visualize the effect of interaction between two continuous independent variables on a response variable
Examples
require(ggplot2)
require(ggiraph)
ggEffect(mtcars,aes(x=wt,y=mpg,color=hp))
ggEffect(mtcars,aes(x=wt,y=mpg,color=hp),interactive=TRUE)
require(moonBook)
ggEffect(acs,aes(x=height,y=weight,color=smoking))
ggEffect(acs,aes(x=height,y=weight,color=smoking),interactive=TRUE)
require(ggplot2)
require(ggiraph)
require(moonBook)
ggEffect(NTAV~age*smoking,data=radial)
require(moonBook)
require(ggplot2)
require(ggiraph)
fit=lm(age~sex*smoking,data=acs)
ggEffect(fit,interactive=TRUE)
ggEffect(radial,aes(x=age,y=NTAV,color=smoking))
ggEffect(radial,aes(x=age,y=NTAV,color=smoking),interactive=TRUE)