Generation

generate functionTue, 18 Apr 2023

> table(indvar_FODs$categorical_FOD_FODs) ascending descending identity 1683 1432 206 > table(indvar_FODs$Condition_FODs) A B C D 880 880 880 880 > table(indvar_FODs$Language_used_FODs) English German Hungarian Italian Turkish 880 160 160 160 2160 > table(indvar_FODs$subject_FODs) P01 P02 P03 P04 P05 P06 P07 P08 P09 P10 P11 P12 P13 P14 P15 P16 P17 P18 P19 P20 P21 P22 P23 P24 P25 P26 P27 P28 P29 P30 P31 P32 P33 P34 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 P35 P36 P37 P38 P39 P40 P41 P42 P43 P44 80 80 80 80 80 80 80 80 80 80 The dependent variable 'categorical_FOD_FODs' is a categorical variable. The response is a categorical variable. Using 'lme4' package logistic regression, please test if 'Condition_FODs' (categorical data) and 'Language_used_FODs' (categorical data), and the interaction effect between 'Condition_FODs' and 'Language_used_FODs' has an effect on the 'categorical_FOD_FODs' which is the dependent variable (categorical data). Then add code for the optimizer. Afterwards add code for if there is singularity for lme4 Then add code for the post-hoc analysis

# load lme4 package library(lme4) # load multicomp package library(multicomp) # load the data IndVar_FODs <- read.csv("/Users/sarahszalay/Dropbox/Thesis/Data/IndVar_FODs.csv", header = TRUE) IndVar_FODs$categorical_FOD_FODs <- factor(IndVar_FODs$categorical_FOD_FODs) IndVar_FODs$Condition_FODs <- factor(IndVar_FODs$Condition_FODs) IndVar_FODs$Language_used_FODs <- factor(IndVar_FODs$Language_used_FODs) IndVar_FODs$subject_FODs <- factor(IndVar_FODs$subject_FODs) IndVar_FODs$Language_used_FODs <- relevel(IndVar_FODs$Language_used_FODs, "English") IndVar_F

Questions about programming?Chat with your personal AI assistant