ez_group_id_mod_table: Easily Table Model with Group and Individual Difference...

Description Usage Arguments Value Examples

View source: R/ez_tables.R

Description

This takes output from one of the group- and individual-level moderated reputation models (e.g., rep_accuracy_group_id_mods) and returns a tibble of model (regression) parameters. It works with any of the Group- and Individual-level moderated models.

Usage

1

Arguments

rep_model

The results from one of the ReputationModelR group- and individual-level moderator Models (e.g., rep_accuracy_group_id_mods).

Value

The function returns an object of class tbl_df.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
data("rep_sim_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)

# Example for hearsay accuracy with no equality constraints
agree_pt_mod_fit <- rep_accuracy_group_id_mods(moderator_data,
                                          target_self = c("C_C_agreeableness", "A_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"),
                                          group_mod = "study")
 ez_group_id_mod_table(agree_pt_mod_fit)

 # Example for hearsay accuracy with all parameters equal across all groups
 agree_pt_mod_fit_alleq <- rep_accuracy_group_id_mods(moderator_data,
                                          target_self = c("C_C_agreeableness", "A_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"),
                                          group_mod = "study", groups_eql = "all", params_eql = "all")
 ez_group_id_mod_table(agree_pt_mod_fit_alleq)

 # Example with some equality constraints

 agree_pt_mod_fit_someeql <-  rep_accuracy_group_id_mods(moderator_data,
                                                         target_self = c("C_C_agreeableness", "A_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"),
                                                         group_mod = "group_var", groups_eql = c(1, 4), params_eql = "all")

ez_group_id_mod_table(agree_pt_mod_fit_someeql)

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