two_way_interaction_plot: Create a two-way interaction plot

Description Usage Arguments Value

View source: R/two_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
two_way_interaction_plot(
  data,
  nlme_object,
  predict_var_name,
  graph_label_name = NULL,
  cateogrical_var = NULL,
  y_lim = NULL,
  plot_color = F,
  debug = F
)

Arguments

data

dataframe.

nlme_object

lme object from 'nlme::lme'

predict_var_name

vector of length 2. predictive variable names

graph_label_name

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

cateogrical_var

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

y_lim

vector of length 2. c(lower_limit, upper_limit)

plot_color

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

debug

ingore this parameter

Value

ggplot object. two-way interaction plot


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