plot.confound.grid: Plot a grid of x y plots split by a confounder z

View source: R/plotting.R

plot.confound.gridR Documentation

Plot a grid of x y plots split by a confounder z

Description

Plot a grid of x y plots showing how a third confounding variable 'z' changes the slope

Usage

## S3 method for class 'confound.grid'
plot(x, Y='y', X='x', confounder='z', breaks=3,...)

Arguments

x

a data frame

Y

the name of the column with the dependent/outcome variable

X

the name of the column with the predictor variable

confounder

the name of the column with confounding variable

breaks

number or vector of breaks to split the plots horizontally (across x)

...

other arguments passed to 'plot'

Value

a confound grid plot

Examples


path <- system.file("extdata","primate-example.data.csv", package="mmodely")
data <- read.csv(path, row.names=1)
data$col <- c('yellow','red')[data$nocturnal+1]

plot.confound.grid(x=data, Y='OC', X='leap.pct', confounder='mass.Kg')


mmodely documentation built on May 31, 2023, 6:47 p.m.