Hi Jarret,
Thank you for your answer. I get the following message:
Error in cov(a.df[, 2:7], nrow(a.df)) : incompatible dimensions
The function seems to run for some countries but then appears to stop
when a country has incomplete data (1 var is missing, for example).
How to force the function t
You may want to take a look at the lavaan package and use the multigroup
analysis there (and see if you even need to group by country as well).
Otherwise, you could do something like
library(sem)
library(plyr)
cfa_func<-function(a.df){
cfa<-sem(ses.model, cov(a.df[,2:7], nrow(a.df)))
2 matches
Mail list logo