library(metaSEM) setwd("C:/Users/anyul/Dropbox/Papers/SOR meta/meta") mydatar <- readFullMat("C:/Users/anyul/Dropbox/Papers/SOR meta/data.txt") mydatan <- c(253,290,534,529,220,196,270,354,435,463) # Add names in mydatar matrices mydatar <- lapply(mydatar, function(x) { dimnames(x) <- list(c("Acto","Actu_exp","Actu_vis","Aest_emo","Aest_jud","Aest","Affe_att","Affe_sta1","Affe_sta2","Ambi","Appr_beh","Aros","Atmo", "Atti","Auth_exp","Avoi_beh","Beha_int","Cele_eff","Chee_beh","City_uni","Cogn_sta1","Cogn_sta2","Comp","Cons_ret", "Core_ser","Cosp","Cult_env", "Cult_ide","Cust_int","Cust","Desi","Dini_equ","Eco_lab","Effe","Emot_exh","Emot_exp","Emot_spa","Emot_val","Emot","Enga","Envi_adv","Envi_awa", "Envi_con","Envi_kno","Esca","Extr_mot","Fest_exp","Fest","Flow","Food_aro","Food_qua","Frug","Func_val","Func","Gamb_val","Gree_beh","Hedo_val", "High_tas","Iden","Imag","Impr_of","Impu_buy","Info_qua","Info","Infr_env","Inno_beh","Inte_convol","Inte_fai","Inte_com","Intr_mot","Kine","Layo", "Ligh","Limi_exp","LTRC_imag","LTRC_soun","Loya","Mean","Memo","Mobi_pho","Musi_eff","Natu_sou","Natu_tou","Nega_emo","Nove","Outc_fai","Para", "Perc_bra","Perc_coh","Perc_con","Perc_eas","Perc_enj","Perc_ent","Perc_inter","Perc_intim","Perc_mob","Perc_pla","Perc_qua","Perc_ris","Perc_sec", "Perc_soc","Perc_use","Perc_val","Phys_app","Phys_env","Phys_tou","Plac_dep","Plac_ide","Plea","Poin_and","Port","Posi_emo","Posi_sur","Pric_fai", "Proc_fai","Prod_ava","Prod_pre","Prof_com","Prog","Prox","Purc_int","Qual_of","Reco","Rela_adv","Repu_int","Repu","Revi_int","Sati","Sear_for", "Self_con","Selfb_conn","Selfd","Sens_of","Serv_qua","Serv_sta","Sett","Simi","Soci_bon","Soci_den","Soci_int","Soci_pre","Soci_tou","Soci_val", "Soci_sym","Spat_pre","Spat_pre","Spat_sit","Stru","Subj_nor","Suit_beh","Supp","Susp_of","Syst_and","Syst_qua","Tabl_set","Tech_att","Touc_sti", "Tour_gui","Tran_rel","Trus","User_int","User_dec","Util_val","Visi_int","Visu_eff","Voca_eff","Volu_man","Wayz","Webs_qua","Well","WOM_rec", "Work_cli"), c("Acto","Actu_exp","Actu_vis","Aest_emo","Aest_jud","Aest","Affe_att","Affe_sta1","Affe_sta2","Ambi","Appr_beh","Aros","Atmo", "Atti","Auth_exp","Avoi_beh","Beha_int","Cele_eff","Chee_beh","City_uni","Cogn_sta1","Cogn_sta2","Comp","Cons_ret", "Core_ser","Cosp","Cult_env", "Cult_ide","Cust_int","Cust","Desi","Dini_equ","Eco_lab","Effe","Emot_exh","Emot_exp","Emot_spa","Emot_val","Emot","Enga","Envi_adv","Envi_awa", "Envi_con","Envi_kno","Esca","Extr_mot","Fest_exp","Fest","Flow","Food_aro","Food_qua","Frug","Func_val","Func","Gamb_val","Gree_beh","Hedo_val", "High_tas","Iden","Imag","Impr_of","Impu_buy","Info_qua","Info","Infr_env","Inno_beh","Inte_convol","Inte_fai","Inte_com","Intr_mot","Kine","Layo", "Ligh","Limi_exp","LTRC_imag","LTRC_soun","Loya","Mean","Memo","Mobi_pho","Musi_eff","Natu_sou","Natu_tou","Nega_emo","Nove","Outc_fai","Para", "Perc_bra","Perc_coh","Perc_con","Perc_eas","Perc_enj","Perc_ent","Perc_inter","Perc_intim","Perc_mob","Perc_pla","Perc_qua","Perc_ris","Perc_sec", "Perc_soc","Perc_use","Perc_val","Phys_app","Phys_env","Phys_tou","Plac_dep","Plac_ide","Plea","Poin_and","Port","Posi_emo","Posi_sur","Pric_fai", "Proc_fai","Prod_ava","Prod_pre","Prof_com","Prog","Prox","Purc_int","Qual_of","Reco","Rela_adv","Repu_int","Repu","Revi_int","Sati","Sear_for", "Self_con","Selfb_conn","Selfd","Sens_of","Serv_qua","Serv_sta","Sett","Simi","Soci_bon","Soci_den","Soci_int","Soci_pre","Soci_tou","Soci_val", "Soci_sym","Spat_pre","Spat_pre","Spat_sit","Stru","Subj_nor","Suit_beh","Supp","Susp_of","Syst_and","Syst_qua","Tabl_set","Tech_att","Touc_sti", "Tour_gui","Tran_rel","Trus","User_int","User_dec","Util_val","Visi_int","Visu_eff","Voca_eff","Volu_man","Wayz","Webs_qua","Well","WOM_rec", "Work_cli")) x}) ## First stage analysis random1 <- tssem1(mydatar, mydatan, method="REM", RE.type="Diag") summary(random1) ## Factor loadings L_temp <- read.csv("C:/Users/anyul/Dropbox/Papers/SOR meta/Summary_constructs.csv") Lambda <- matrix(c(L_temp$S,L_temp$O,L_temp$R), ncol = 3, nrow = 172) ## It is easier to create A this way since there are lots of 0 A1 <- rbind(cbind(matrix(0,ncol=172,nrow=172), Lambda), matrix(0,ncol=175,nrow=3)) dimnames(A1)<-list(c("Acto","Actu_exp","Actu_vis","Aest_emo","Aest_jud","Aest","Affe_att","Affe_sta1","Affe_sta2","Ambi","Appr_beh","Aros","Atmo", "Atti","Auth_exp","Avoi_beh","Beha_int","Cele_eff","Chee_beh","City_uni","Cogn_sta1","Cogn_sta2","Comp","Cons_ret", "Core_ser","Cosp","Cult_env", "Cult_ide","Cust_int","Cust","Desi","Dini_equ","Eco_lab","Effe","Emot_exh","Emot_exp","Emot_spa","Emot_val","Emot","Enga","Envi_adv","Envi_awa", "Envi_con","Envi_kno","Esca","Extr_mot","Fest_exp","Fest","Flow","Food_aro","Food_qua","Frug","Func_val","Func","Gamb_val","Gree_beh","Hedo_val", "High_tas","Iden","Imag","Impr_of","Impu_buy","Info_qua","Info","Infr_env","Inno_beh","Inte_convol","Inte_fai","Inte_com","Intr_mot","Kine","Layo", "Ligh","Limi_exp","LTRC_imag","LTRC_soun","Loya","Mean","Memo","Mobi_pho","Musi_eff","Natu_sou","Natu_tou","Nega_emo","Nove","Outc_fai","Para", "Perc_bra","Perc_coh","Perc_con","Perc_eas","Perc_enj","Perc_ent","Perc_inter","Perc_intim","Perc_mob","Perc_pla","Perc_qua","Perc_ris","Perc_sec", "Perc_soc","Perc_use","Perc_val","Phys_app","Phys_env","Phys_tou","Plac_dep","Plac_ide","Plea","Poin_and","Port","Posi_emo","Posi_sur","Pric_fai", "Proc_fai","Prod_ava","Prod_pre","Prof_com","Prog","Prox","Purc_int","Qual_of","Reco","Rela_adv","Repu_int","Repu","Revi_int","Sati","Sear_for", "Self_con","Selfb_conn","Selfd","Sens_of","Serv_qua","Serv_sta","Sett","Simi","Soci_bon","Soci_den","Soci_int","Soci_pre","Soci_tou","Soci_val", "Soci_sym","Spat_pre","Spat_pre","Spat_sit","Stru","Subj_nor","Suit_beh","Supp","Susp_of","Syst_and","Syst_qua","Tabl_set","Tech_att","Touc_sti", "Tour_gui","Tran_rel","Trus","User_int","User_dec","Util_val","Visi_int","Visu_eff","Voca_eff","Volu_man","Wayz","Webs_qua","Well","WOM_rec", "Work_cli","S","O","R"),c("Acto","Actu_exp","Actu_vis","Aest_emo","Aest_jud","Aest","Affe_att","Affe_sta1","Affe_sta2","Ambi","Appr_beh","Aros","Atmo", "Atti","Auth_exp","Avoi_beh","Beha_int","Cele_eff","Chee_beh","City_uni","Cogn_sta1","Cogn_sta2","Comp","Cons_ret", "Core_ser","Cosp","Cult_env", "Cult_ide","Cust_int","Cust","Desi","Dini_equ","Eco_lab","Effe","Emot_exh","Emot_exp","Emot_spa","Emot_val","Emot","Enga","Envi_adv","Envi_awa", "Envi_con","Envi_kno","Esca","Extr_mot","Fest_exp","Fest","Flow","Food_aro","Food_qua","Frug","Func_val","Func","Gamb_val","Gree_beh","Hedo_val", "High_tas","Iden","Imag","Impr_of","Impu_buy","Info_qua","Info","Infr_env","Inno_beh","Inte_convol","Inte_fai","Inte_com","Intr_mot","Kine","Layo", "Ligh","Limi_exp","LTRC_imag","LTRC_soun","Loya","Mean","Memo","Mobi_pho","Musi_eff","Natu_sou","Natu_tou","Nega_emo","Nove","Outc_fai","Para", "Perc_bra","Perc_coh","Perc_con","Perc_eas","Perc_enj","Perc_ent","Perc_inter","Perc_intim","Perc_mob","Perc_pla","Perc_qua","Perc_ris","Perc_sec", "Perc_soc","Perc_use","Perc_val","Phys_app","Phys_env","Phys_tou","Plac_dep","Plac_ide","Plea","Poin_and","Port","Posi_emo","Posi_sur","Pric_fai", "Proc_fai","Prod_ava","Prod_pre","Prof_com","Prog","Prox","Purc_int","Qual_of","Reco","Rela_adv","Repu_int","Repu","Revi_int","Sati","Sear_for", "Self_con","Selfb_conn","Selfd","Sens_of","Serv_qua","Serv_sta","Sett","Simi","Soci_bon","Soci_den","Soci_int","Soci_pre","Soci_tou","Soci_val", "Soci_sym","Spat_pre","Spat_pre","Spat_sit","Stru","Subj_nor","Suit_beh","Supp","Susp_of","Syst_and","Syst_qua","Tabl_set","Tech_att","Touc_sti", "Tour_gui","Tran_rel","Trus","User_int","User_dec","Util_val","Visi_int","Visu_eff","Voca_eff","Volu_man","Wayz","Webs_qua","Well","WOM_rec", "Work_cli","S","O","R")) ## Covariance matrix among the latent factors Phi <- matrix(c(1, "0.3*cor", "0.3*cor","0.3*cor",1,"0.3*cor","0.3*cor","0.3*cor",1), ncol=3, nrow=3) ## Error variances among the errors Psi <- Diag(c(L_temp$e)) S1 <- bdiagMat(list(Psi, Phi)) dimnames(S1) <- dimnames(A1) F1 <- create.Fmatrix(c(rep(1,172),0, 0, 0), as.mxMatrix=FALSE) dimnames(F1) <- list(c("Acto","Actu_exp","Actu_vis","Aest_emo","Aest_jud","Aest","Affe_att","Affe_sta1","Affe_sta2","Ambi","Appr_beh","Aros","Atmo", "Atti","Auth_exp","Avoi_beh","Beha_int","Cele_eff","Chee_beh","City_uni","Cogn_sta1","Cogn_sta2","Comp","Cons_ret", "Core_ser","Cosp","Cult_env", "Cult_ide","Cust_int","Cust","Desi","Dini_equ","Eco_lab","Effe","Emot_exh","Emot_exp","Emot_spa","Emot_val","Emot","Enga","Envi_adv","Envi_awa", "Envi_con","Envi_kno","Esca","Extr_mot","Fest_exp","Fest","Flow","Food_aro","Food_qua","Frug","Func_val","Func","Gamb_val","Gree_beh","Hedo_val", "High_tas","Iden","Imag","Impr_of","Impu_buy","Info_qua","Info","Infr_env","Inno_beh","Inte_convol","Inte_fai","Inte_com","Intr_mot","Kine","Layo", "Ligh","Limi_exp","LTRC_imag","LTRC_soun","Loya","Mean","Memo","Mobi_pho","Musi_eff","Natu_sou","Natu_tou","Nega_emo","Nove","Outc_fai","Para", "Perc_bra","Perc_coh","Perc_con","Perc_eas","Perc_enj","Perc_ent","Perc_inter","Perc_intim","Perc_mob","Perc_pla","Perc_qua","Perc_ris","Perc_sec", "Perc_soc","Perc_use","Perc_val","Phys_app","Phys_env","Phys_tou","Plac_dep","Plac_ide","Plea","Poin_and","Port","Posi_emo","Posi_sur","Pric_fai", "Proc_fai","Prod_ava","Prod_pre","Prof_com","Prog","Prox","Purc_int","Qual_of","Reco","Rela_adv","Repu_int","Repu","Revi_int","Sati","Sear_for", "Self_con","Selfb_conn","Selfd","Sens_of","Serv_qua","Serv_sta","Sett","Simi","Soci_bon","Soci_den","Soci_int","Soci_pre","Soci_tou","Soci_val", "Soci_sym","Spat_pre","Spat_pre","Spat_sit","Stru","Subj_nor","Suit_beh","Supp","Susp_of","Syst_and","Syst_qua","Tabl_set","Tech_att","Touc_sti", "Tour_gui","Tran_rel","Trus","User_int","User_dec","Util_val","Visi_int","Visu_eff","Voca_eff","Volu_man","Wayz","Webs_qua","Well","WOM_rec", "Work_cli"),c("Acto","Actu_exp","Actu_vis","Aest_emo","Aest_jud","Aest","Affe_att","Affe_sta1","Affe_sta2","Ambi","Appr_beh","Aros","Atmo", "Atti","Auth_exp","Avoi_beh","Beha_int","Cele_eff","Chee_beh","City_uni","Cogn_sta1","Cogn_sta2","Comp","Cons_ret", "Core_ser","Cosp","Cult_env", "Cult_ide","Cust_int","Cust","Desi","Dini_equ","Eco_lab","Effe","Emot_exh","Emot_exp","Emot_spa","Emot_val","Emot","Enga","Envi_adv","Envi_awa", "Envi_con","Envi_kno","Esca","Extr_mot","Fest_exp","Fest","Flow","Food_aro","Food_qua","Frug","Func_val","Func","Gamb_val","Gree_beh","Hedo_val", "High_tas","Iden","Imag","Impr_of","Impu_buy","Info_qua","Info","Infr_env","Inno_beh","Inte_convol","Inte_fai","Inte_com","Intr_mot","Kine","Layo", "Ligh","Limi_exp","LTRC_imag","LTRC_soun","Loya","Mean","Memo","Mobi_pho","Musi_eff","Natu_sou","Natu_tou","Nega_emo","Nove","Outc_fai","Para", "Perc_bra","Perc_coh","Perc_con","Perc_eas","Perc_enj","Perc_ent","Perc_inter","Perc_intim","Perc_mob","Perc_pla","Perc_qua","Perc_ris","Perc_sec", "Perc_soc","Perc_use","Perc_val","Phys_app","Phys_env","Phys_tou","Plac_dep","Plac_ide","Plea","Poin_and","Port","Posi_emo","Posi_sur","Pric_fai", "Proc_fai","Prod_ava","Prod_pre","Prof_com","Prog","Prox","Purc_int","Qual_of","Reco","Rela_adv","Repu_int","Repu","Revi_int","Sati","Sear_for", "Self_con","Selfb_conn","Selfd","Sens_of","Serv_qua","Serv_sta","Sett","Simi","Soci_bon","Soci_den","Soci_int","Soci_pre","Soci_tou","Soci_val", "Soci_sym","Spat_pre","Spat_pre","Spat_sit","Stru","Subj_nor","Suit_beh","Supp","Susp_of","Syst_and","Syst_qua","Tabl_set","Tech_att","Touc_sti", "Tour_gui","Tran_rel","Trus","User_int","User_dec","Util_val","Visi_int","Visu_eff","Voca_eff","Volu_man","Wayz","Webs_qua","Well","WOM_rec", "Work_cli","S","O","R")) ## Second stage analysis random2 <- tssem2(random1, Amatrix=A1, Smatrix=S1, Fmatrix=F1,intervals.type="LB", model.name="SOR",mx.algebras=list(Med=mxAlgebra(S2O*O2R, name="Indirect")))