rep_consensus_group_id_mods_builder: Hearsay Consensus Model with Individual-Level and Group...

Description Usage Arguments Details Value Examples

Description

This function builds a lavaan model for asssessing individual-level moderators of hearsay consensus across multiple groups. It requires names of columns for P1 reports, P2 reports, an Individual Difference Moderator Variable, an interaction term, and a set of group labels. The baseline model (built by this function) estimates the following parameters per group:

Usage

1
2
3
4
rep_consensus_group_id_mods_builder(p1_reports, p2_reports,
  id_mod_variable, interaction_term, groups = NULL, use_labs = TRUE,
  n_triads = length(p1_reports), n_p1s_per_p2s = 1,
  n_p2s_per_p1s = 1)

Arguments

p1_reports

Quoted column names that contain P1 reports, or ratings made by the person that knows the target directly. If more than one is supplied, the target-wise order must match the other rating types.

p2_reports

Quoted column names that contain P2 reports, or ratings made by the person that knows the target indirectly through the corresponding P1. Ratings should be grand-mean-centered to increase the interpretibility of the model parameters. If more than one is supplied, the target-wise order must match the other rating types.

id_mod_variable

Quoted column names that contain the individual-level moderator of interest. If more than one is supplied from multiple exchangeable triads, the order must match the order of the ratings. Like P2-reports, the variable should be mean-centered to facilitate interpretability.

interaction_term

Quoted column names that contain the interaction term, or the product of the mean-centered P2-report and the mean-centered moderator variable. If more than one is supplied from multiple exchangeable triads, the target-wise order must match the order of the ratings.

groups

Vector of quoted group labels (from group-level categorical moderator).

use_labs

Logical indicating whether or not to use the group labels to create the parameter labels. If FALSE, generic labels (grp1 to grpk, where k is the number of groups) are used.

n_triads

The number of exchangeable triads in each group. By default, this is determined by counting the number of P1 reports. This parameter rarely needs to be changed.

n_p1s_per_p2s

The number of P1s for every P2. This defaults to 1. Currently, only values of 1 are supported.

n_p2s_per_p1s

The number of P2s for every P1;. This defaults to 1. Currently, only values of 1 are supported.

Details

hc_me

hearsay consensus main effect; this should correspond to hearsay consensus at average level of moderator variable (if data were properly mean-centered).

mod_me

The meain effect of the moderator variable; it can be interpreted as the difference in P1-reports related to differences in the individual-level moderator variable.

interaction

This is the interaction term. It indicates the extent to which hearsay consensus, depends on the moderator variable

v_p1

variance for P1(T)

v_p2

variance for P2(T)

v_mod

variance for moderator variable

v_interaction

variance for interaction term

int_p1

intercept for P1(T)

int_p2

intercept for P2(T)

int_mod

intercept for moderator variable

int_interaction

intercept for interaction term

The function can handle up to n exchangeable triads.

Value

The function returns an object of class lavaan.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data("rep_sim_data")
          # Prepare data
         moderator_data <- rep_sim_data %>%
           dplyr::mutate(B_C_agreeableness_cent = scale(B_C_agreeableness, scale = FALSE),
                  D_A_agreeableness_cent = scale(D_A_agreeableness, scale = FALSE),
                  B_iri_perspective_cent = scale(B_iri_perspective, scale = FALSE),
                  D_iri_perspective_cent = scale(D_iri_perspective, scale = FALSE),
                  B_ptXagree_interaction = B_C_agreeableness_cent*B_iri_perspective_cent,
                  D_ptXagree_interaction = D_A_agreeableness_cent*D_iri_perspective_cent)

# build a model examining perspective taking moderating hearsay consensus across two studies
agree_pt_mod_model <- rep_consensus_group_id_mods_builder (p1_reports = c("A_C_agreeableness", "C_A_agreeableness"),
                                                     p2_reports = c("B_C_agreeableness_cent", "D_A_agreeableness_cent"),
                                                     id_mod_variable = c("B_iri_perspective_cent", "D_iri_perspective_cent"),
                                                     interaction_term = c("B_ptXagree_interaction", "D_ptXagree_interaction"),
                                                     groups = c("study1", "study2"))

Coryc3133/ReputationAnalyses documentation built on July 31, 2019, 8:35 a.m.