I have been trying to run this code and nothing is working but it did work a while ago. I do not know what I am doing wrong. I also combined a data set and this is the code I put(I do not know which is the issue)
The error I keep getting is on the line of "fit_CFA_groups", and it states
Error in file(file, "r") : cannot open the connection
3.
file(file, "r")
2.
scan(file = file, what = "", sep = ";", strip.white = TRUE, comment.char = "#")
1.
cfa(three_factor_groups, data = df3, group = "country")
This is the code I have put in
library(haven) #packages
library(dplyr)
library(vctrs)
library(haven)
NewIrishdata <- read_sav("NewIrishdata.sav")
df3 <- bind_rows(Englishdark, NewIrishdata)
df3
library(haven)
require(semTools)
library(semTools)
library(psych)
library(readr)
require(sem)
library(sem)
three_factor_groups <-
'General =~ Machiavellianism1 + Machiavellianism2 + Machiavellianism3 + Machiavellianism4 + Machiavellianism5 + Machiavellianism6 + Machiavellianism7 + Machiavellianism8 + Machiavellianism9
+ Narcissism1 + Narcissism2 + Narcissism3 + Narcissism4 + Narcissism5 + Narcissism6 + Narcissism7 + Narcissism8 + Narcissism9 + Psychopathy1 + Psychopathy2 + Psychopathy3 + Psychopathy4 + Psychopathy5 + Psychopathy6 + Psychopathy7 + Psychopathy8 + Psychopathy9'
fit_CFA_groups<-cfa(three_factor_groups, data= df3, group="country")
summary(fit_CFA_groups)
require(semPlot)
library(semPlot)
require(qgraph)
semPaths(fit_CFA_groups, layout='circle',style = "lisrel",what="std", combineGroups = F)