three_way_interaction_plot: Create a three-way interaction plot

Description Usage Arguments Value

View source: R/three_way_interaction_plot.R

Description

This will create a three-way interaction plot. It uses the predict function on the lme object to get the values of the independent variable using the values of the independent variable that is 1 standard deviation above and below the mean.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
three_way_interaction_plot(
  data,
  nlme_object,
  predict_var_name,
  cateogrical_var = NULL,
  graph_label_name = NULL,
  y_lim = NULL,
  debug = F,
  plot_color = F
)

Arguments

data

dataframe

nlme_object

lme object from 'nlme::lme'

predict_var_name

vector of length 3. the variables' name for the two-way interaction plot

cateogrical_var

list. use the form list(var_name1 = c(upper_bound1, lower_bound1), [var_name2 = c(upper_bound2, lower_bound2])

graph_label_name

vector of length 3 or function. Vector should be passed in the form of c(response_var, predict_var1, predict_var2, predict_var3). Function should be passed as a switch function that return the label based on the name passed (e.g., a switch function)

y_lim

vector of two number. set the y_lim of the plot

debug

ingore this parameter

plot_color

logical. default as F. Set to T if you want to plot in color

Value

ggplot object. three-way interaction plot


jasonmoy28/HLM_Model_R_Package documentation built on March 9, 2021, 3:05 p.m.