ggEffect: Visualize the effect of interaction between two continuous...

Description Usage Arguments Value Methods (by class) Examples

View source: R/ggEffect.R

Description

Visualize the effect of interaction between two continuous independent variables on a response variable

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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)

Example output

Loading required package: ggplot2
Loading required package: ggiraph
Loading required package: moonBook

Attaching package:moonBookThe following objects are masked frompackage:ggiraphExtra:

    addLabelDf, getMapping

ggiraphExtra documentation built on Oct. 23, 2020, 7:39 p.m.