Dear Anne, I started to diagram your model but stopped when I noticed some problems: (1) Some variables, such as pays_alti, are clearly endogenous, since they have arrows pointing to them, yet are declared as fixed exogenous variables; that clearly doesn't make sense. (2) You've placed conflicting constraints on factor loadings and the variances of latent variables, for example setting both the path from the factor type_paysage to the indicator pays_alti and the variance of type_paysage to 1; again, that doesn't make sense.
Do you have a path diagram for the model that you're trying to fit? It would in particular be helpful to have a diagram of the structural part of the model. Regards, John -------------------------------- John Fox Senator William McMaster Professor of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada web: socserv.mcmaster.ca/jfox > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Anne Mimet > Sent: August-25-10 10:27 AM > To: r-help@r-project.org > Subject: [R] SEM : Warning : Could not compute QR decomposition of Hessian > > Hi useRs, > > I'm trying for the first time to use a sem. The model finally runs, > but gives a warning saying : > "In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names > = vars, : Could not compute QR decomposition of Hessian. > Optimization probably did not converge. " > > I found in R-help some posts on this warning, but my attemps to modify > the code didn't change the warning message (i tried to give an error > of 1 to the latente variables). I can't figure what the problem is. > Here is the code : > > > tab<-read.table("F:/Mes documents/stats/sem/donnees_corr.txt", > header=T, sep="",na.strings = "NA") > > tab[,46]<-as.factor(tab[,46]) > tab[,24]<-as.factor(tab[,24]) > tab[,40]<-as.factor(tab[,40]) > > fct_cor<-hetcor(tab, ML=T) > cor_tab<- fct_cor$correlations > > moment_tab<-read.moments(diag=F, names=c('c1','c2', 'c3','c4','c5', > 'c6','c7', 'c8', 'c9', 'ind_plando', 'long_sup15', 'long_inf15', > 'pente', 'est', 'sud','ouest', 'nord' ,'reg_hydriq', 'prof_sol', > 'pierro', 'efferv', 'struct','drainage','texture', 'route1_pond', > 'route2_pond', > 'pourcactif', 'tx_chomage', 'pourcagric', 'pourc_jeunes', 'pop99', > 'rev_imp_foyer','eq_CONC', 'eq_sante', 'eq_edu', 'sold_nat', > 'sold_mig', 'tps_dom_emp','TXEMPLOI','ORIECO','dist_paris','axe1', > 'axe2', 'axe3', 'dist_protect','urbanisation','pays_incli','pays_alti')) > # after comes the moment matrix (triangular) > > ram_tab<-specify.model() > type_paysage->pays_alti,NA,1 > type_paysage->pays_incli, pays2, NA > pedo->reg_hydriq, NA, 1 > pedo->prof_sol, ped8, NA > pedo->pierro, ped9, NA > pedo->efferv, ped10, NA > pedo->struct, ped11, NA > pedo->drainage, ped12, NA > pedo->texture, ped13, NA > adj_99->c1, NA,1 > adj_99->c2, adj2,NA > adj_99->c3, adj3,NA > adj_99->c4, adj4,NA > adj_99->c5, adj5,NA > adj_99->c6, adj6,NA > adj_99->c7, adj7,NA > adj_99->c8, adj8,NA > adj_99->c9, adj9,NA > etat_hexa->axe1, NA, 1 > etat_hexa->axe2, et2, NA > etat_hexa->axe3, et3, NA > socioBV->sold_mig, BV1, NA > socioBV->sold_nat, BV2, NA > socioBV->TXEMPLOI, BV3, NA > socioBV->ORIECO, BV4, NA > socioBV->tps_dom_emp, NA, 1 > eqBV->eq_CONC, NA, 1 > eqBV->eq_sante, eq2, NA > eqBV->eq_edu, eq3, NA > socio_com->pourcactif , NA, 1 > socio_com->tx_chomage, com2, NA > socio_com->pourcagric, com3, NA > socio_com->pourc_jeunes, com4, NA > socio_com->pop99, com5, NA > socio_com->rev_imp_foyer, com7, NA > access_hexa->route1_pond, NA, 1 > access_hexa->route2_pond, acc2, NA > hydro->ind_plando, NA, 1 > hydro->long_sup15, eau2, NA > hydro->long_inf15, eau3, NA > topog->pente, NA, 1 > topog->est, top2, NA > topog->sud, top3, NA > topog->nord, top4, NA > topog->ouest, top5, NA > dist_protect-> urbanisation, cor1,NA > dist_protect-> adj_99, cor2, NA > dist_protect-> etat_hexa, cor3, NA > topog-> urbanisation, cor4, NA > topog-> adj_99, cor5, NA > topog-> etat_hexa, cor6, NA > topog-> access_hexa, cor7, NA > topog<->hydro, cor8, NA > topog<->pedo, cor9, NA > pedo-> urbanisation, cor10, NA > pedo-> adj_99, cor11, NA > pedo-> etat_hexa, cor12, NA > pedo<->hydro, cor1, NA > hydro-> urbanisation, cor13, NA > hydro-> adj_99, cor14, NA > hydro-> etat_hexa, cor15, NA > access_hexa-> urbanisation, cor16, NA > access_hexa-> etat_hexa, cor17, NA > socio_com-> etat_hexa, cor18, NA > socio_com-> adj_99, cor19, NA > socio_com-> urbanisation, cor20, NA > dist_paris-> socio_com, cor21, NA > dist_paris-> access_hexa, cor22, NA > dist_paris-> adj_99, cor23, NA > dist_paris-> etat_hexa, cor24, NA > dist_paris-> urbanisation, cor25, NA > dist_paris-> socioBV, cor26, NA > socioBV-> eqBV, cor27, NA > socioBV-> urbanisation, cor28, NA > socioBV-> adj_99, cor29, NA > socioBV-> etat_hexa, cor30, NA > eqBV-> etat_hexa, cor31, NA > eqBV-> adj_99, cor32, NA > eqBV-> urbanisation, cor33, NA > etat_hexa-> urbanisation, cor34, NA > etat_hexa<-> adj_99, cor35, NA > adj_99-> urbanisation, cor36, NA > type_paysage-> urbanisation, cor37, NA > type_paysage-> adj_99, cor38, NA > type_paysage-> etat_hexa, cor39, NA > dist_paris<->dist_paris, auto1, NA > dist_protect<->dist_protect, auto2, NA > c1 <-> c1, auto4, NA > c2 <-> c2 , auto5, NA > c3 <-> c3 , auto6, NA > c4 <-> c4 , auto7, NA > c5 <-> c5 , auto8, NA > c6 <-> c6 , auto9, NA > c7 <-> c7 , auto10, NA > c8 <-> c8 , auto11, NA > c9 <-> c9 , auto12, NA > ind_plando <-> ind_plando, auto13, NA > long_sup15 <-> long_sup15 , auto14, NA > long_inf15 <-> long_inf15 , auto15, NA > pente <-> pente , auto16, NA > est<-> est , auto17, NA > sud <-> sud , auto18, NA > ouest<-> ouest , auto19, NA > nord <-> nord , auto20, NA > reg_hydriq <-> reg_hydriq , auto21, NA > prof_sol<-> prof_sol , auto22, NA > pierro <-> pierro , auto23, NA > efferv <-> efferv , auto24, NA > struct <-> struct , auto25, NA > drainage <-> drainage, auto26, NA > texture <-> texture , auto27, NA > route1_pond <->route1_pond , auto30, NA > route2_pond <-> route2_pond , auto31, NA > pourcactif <-> pourcactif , auto32, NA > tx_chomage <-> tx_chomage, auto33, NA > pourcagric <-> pourcagric , auto34, NA > pourc_jeunes<-> pourc_jeunes , auto36, NA > pop99<-> pop99 , auto36, NA > rev_imp_foyer <-> rev_imp_foyer , auto38, NA > eq_CONC <-> eq_CONC, auto39, NA > eq_sante <->eq_sante , auto40, NA > eq_edu<->eq_edu , auto41, NA > sold_nat<-> sold_nat , auto42, NA > sold_mig <-> sold_mig , auto43, NA > tps_dom_emp <-> tps_dom_emp , auto44, NA > TXEMPLOI <-> TXEMPLOI , auto45, NA > ORIECO <-> ORIECO , auto46, NA > axe1 <-> axe1 , auto47, NA > axe2 <-> axe2 , auto48, NA > axe3 <-> axe3 , auto49, NA > pays_incli<->pays_incli, auto70, NA > pays_alti<->pays_alti, auto71, NA > urbanisation<-> urbanisation , auto50, NA > type_paysage <-> type_paysage , NA,1 > adj_99 <-> adj_99 , NA ,1 > socioBV <-> socioBV , NA,1 > eqBV <-> eqBV , NA ,1 > socio_com <-> socio_com , NA,1 > access_hexa <-> access_hexa , NA,1 > hydro <-> hydro , NA ,1 > topog <-> topog , NA ,1 > pedo <-> pedo , NA ,1 > eqBV <-> eqBV , NA ,1 > etat_hexa<->etat_hexa, NA ,1 > > sem_dyn<-sem(ram_tab, moment_tab, N=1176, raw=T, > fixed.x=c("pays_alti","reg_hydriq", "c1","axe1", "tps_dom_emp", > "pourcactif", > "route1_pond","ind_plando","pente"), par.size="ones") > > > Any help would be greatly appreciate. > > Thank you, > > Anne > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.