make_path_diagram: Make a Path Diagram for Two Grids

View source: R/GraphingFunctions.R

make_path_diagramR Documentation

Make a Path Diagram for Two Grids

Description

The function make_path_diagram constructs a diagram showing the changes in response from one grid-type item to another for all respondents. The function can be used in two ways: either with LimeSurvey formatted data, or with two lists of grids.

Usage

make_path_diagram(
  grid_data,
  grid_info,
  chosen_item_1,
  chosen_item_2,
  labels = c("agree_disagree", "satisfied_dissatisfied", "positive_negative",
    "accurate_inaccurate", "other"),
  pos_labels = NULL,
  neg_labels = NULL,
  x_axis_label = NULL,
  y_axis_label = NULL,
  item_1_name = "Item 1",
  item_2_name = "Item 2",
  limesurvey = TRUE
)

Arguments

grid_data

data frame of grid-only LimeSurvey formatted data.

grid_info

list. The output of grid_item_info.

chosen_item_1

a number, OR, if limesurvey = FALSE, a list of matrices. The first item of interest.

chosen_item_2

a number, OR, if limesurvey = FALSE, a list of matrices. The second item of interest.

labels

a character string specifying which set of row names and col names are to be used.

pos_labels

character. Custom column names.

neg_labels

character. Custom row names.

x_axis_label

a custom label for the x-axis.

y_axis_label

a custom label for the y-axis.

item_1_name

the name of the first chosen item.

item_2_name

the name of the second chosen item.

limesurvey

logical. If TRUE, grid_data and grid_info must be inputted, and chosen_item_1 and chosen_item_2 should be integers. If FALSE, input chosen_item_1 and chosen_item_2 as lists of matrices, and do not input grid_data and grid_info.

Value

a path diagram showing the shift in each respondent's answer from one item to the other.


douglaswhitaker/GridItemTools documentation built on Aug. 2, 2022, 4:32 a.m.