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

Description Usage Arguments Value Examples

Description

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

Usage

1
2
3
## 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

An integer(1 or 2) indicating which independent variable is used as x-axis variable

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(mtcars)
fit=lm(mpg~wt*hp,data=mtcars)
require(ggplot2)
ggEffect(fit,use.rownames=TRUE)
ggEffect(fit,use.rownames=TRUE,interactive=TRUE)
ggEffect(fit,no=2)
require(moonBook)
fit2=lm(NTAV~age*smoking,data=radial)
ggEffect(fit2,interactive=TRUE)
fit3=lm(age~sex*smoking,data=acs)
ggEffect(fit3,interactive=TRUE)

cardiomoon/moonBook2 documentation built on May 13, 2019, 12:40 p.m.