install.packages("lavaan")
library(foreign)
library(lavaan)
mydata <- read.spss("assignment4(2023).sav", to.data.frame = TRUE)
list out variable
ls(mydata)
specify Model 1 (Simple Regression)
model1 <- "
regression Equation
SWLS ~ SCON
"
fit1 <- lavaan(model1, data=mydata, fixed.x=FALSE, auto.var=TRUE)
Summary(fit1)
when i run these commands, the error message appears:
"One or more of the packages to be updated are currently loaded. Restarting R prior to install is highly recommended. RStudio can restart R before installing the requested packages. All work and data will be preserved during restart. Do you want to restart R prior to install?"
clicked yes but this just keeps reopening