У нас вы можете посмотреть бесплатно Another Method to Creating and Editing Interaction Plots in R Studio или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
In this tutorial, I am going to show you another method on how to create and edit interaction plots in R studio. Below is all the R code I used in this video. Please note that angle brackets are not allowed in youtube video descriptions, so I left notes below where the angle brackets need to be inserted within the code. R Studio Tutorial: Another Method to Creating and Editing Interaction Plots ### ##### PART 1: TWO-WAY INTERACTION ##### Research Question 1: Is there a two-way interaction between men and women employees in the amount of close friends they report at work and their overall job satisfaction? ##### Step 1: Upload dataset ##### Data1 (insert angled bracket here)- read.csv(file.choose()) head(Data1) ##### Step 2: Run an interaction / moderator analysis ##### mod1 (insert angled bracket here)- lm(Job_Satisfaction ~ Friend*Sex, Data1) summary(mod1) ##### Step 3: Run a standard two-way interaction plot #### Open the following libraries library(sjPlot) library(sjmisc) library(ggplot2) Create Plot1 Plot1 (insert angled bracket here)- plot_model(mod1, type = "int", terms = c("Friend", "Sex")) Run Plot1 Plot1 ##### Step 4: Start editing your two-way interaction plot ##### Additional options to change type = "analysis and plotting procedure that is performed" axis.title = "label for y-axis" axis.lim = "range of values along y-axis" title = "title for your plot" legend.title = "title for your legend" Create Plot2 Plot2 (insert angled bracket here)- plot_model(mod1, type = "int", axis.title = "Overall Job Satisfaction", axis.lim = c(1,10), title = "Employees' Overall Job Satisfaction and Close Friends at Work", legend.title = "Gender") Run Plot2 (with x-axis relabelled) Plot2 + labs(x = "Close Friends at Work") ##### Step 5: Properly relabel values for your axis and legend ##### In the previous tutorial we recoded variables library(car) Data1$Sex_recoded (insert angled bracket here)- recode(Data1$Sex, '0 = "Male"; 1 = "Female";', as.factor.result = FALSE) Recoding variables can cause errors in this plotting procedure. In this tutorial we are going to label the variables without changing the values levels(Data1$Friend) = c("Low", "Medium","High","Very High" ) ##### Step 6: Rerun your two-way interaction plot ##### mod2 (insert angled bracket here)- lm(Job_Satisfaction ~ Friend*Sex_recoded, Data1) Plot3 (insert angled bracket here)- plot_model(mod2, type = "int", axis.title = "Overall Job Satisfaction", axis.lim = c(1,10), title = "Employees' Overall Job Satisfaction and Close Friends at Work", legend.title = "Gender") Plot3 + labs(x = "Close Friends at Work") ##### PART 2: THREE-WAY INTERACTION ##### Research Question 2: Is there a three-way interaction between men and women employees, their age, in the amount of close friends they report at work and their overall job satisfaction? ##### Step 7: Three-way interaction ##### mod3 (insert angled bracket here)- lm(Job_Satisfaction ~ Friend*Age*Sex_recoded, Data1) summary(mod3) Plot4 (insert angled bracket here)- plot_model(mod3, type = "int", axis.title = "Overall Job Satisfaction", axis.lim = c(1,10), title = "Employees' Overall Job Satisfaction and Close Friends at Work", legend.title = "Age of Employees", mdrt.values = "quart") Plot4 + labs(x = "Close Friends at Work") Recode AGE min(Data1$Age) max(Data1$Age) Data1$Age_recoded (insert angled bracket here)- recode(Data1$Age, '20:39 = "20-39yrs"; 40:59 = "40-59yrs";', as.factor.result = FALSE) ##### Step 8: Rerun your three-way interaction plot ##### mod4 (insert angled bracket here)- lm(Job_Satisfaction ~ Friend*Age_recoded*Sex_recoded, Data1) summary(mod4) Plot5 (insert angled bracket here)- plot_model(mod4, type = "int", axis.title = "Overall Job Satisfaction", axis.lim = c(1,10), title = "Employees' Overall Job Satisfaction and Close Friends at Work", legend.title = "Age of Employees", mdrt.values = "all") Plot5 + labs(x = "Close Friends at Work")