Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

slope_analysis

Function for plotting a slope analysis for an interaction in a PLS model


Description

slope_analysis generates an interaction plot for the effect of an antecedent on an outcome given a mediator variale.

Usage

slope_analysis(moderated_model, dv, moderator, iv,  leg_place)

Arguments

moderated_model

A SEMinR model that contains an interaction.

dv

The name of the dependant consutruct affected by the moderator (interaction term).

moderator

The name of the moderator construct.

iv

The name of the independant construct affected by the moderator.

leg_place

The location of the legend, in order to make sure the legend does not obscure the plot lines.

Examples

data(mobi)

# seminr syntax for creating measurement model
mobi_mm <- constructs(
composite("Image",        multi_items("IMAG", 1:5)),
composite("Expectation",  multi_items("CUEX", 1:3)),
composite("Value",        multi_items("PERV", 1:2)),
composite("Satisfaction", multi_items("CUSA", 1:3)),
interaction_term(iv = "Image", moderator = c("Expectation"), method = orthogonal))

# Structural model
#  note: interactions should be the names of its main constructs joined by a '*' in between.
mobi_sm <- relationships(
  paths(to = "Satisfaction",
        from = c("Image", "Expectation", "Value",
                 "Image*Expectation")))

# Load data, assemble model, and estimate
mobi_pls <- estimate_pls(data = mobi,
                         measurement_model = mobi_mm,
                         structural_model = mobi_sm)

slope_analysis(mobi_pls, "Satisfaction", "Expectation", "Image", "bottomright")

seminr

Building and Estimating Structural Equation Models

v2.0.2
GPL-3
Authors
Soumya Ray [aut, ths], Nicholas Patrick Danks [aut, cre], André Calero Valdez [aut], Juan Manuel Velasquez Estrada [ctb], James Uanhoro [ctb], Johannes Nakayama [ctb], Lilian Koyan [ctb], Laura Burbach [ctb], Arturo Heynar Cano Bejar [ctb], Susanne Adler [ctb]
Initial release
2021-04-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.