Hu, Ying (NIH/NCI)
2004-Oct-28 19:57 UTC
[R] sem : Error in solve.default(C[ind, ind]) : Lapack routine dgesv: system is exactly singular
Hi R-users: When I run the R script (as the following), I got the error message: Error in solve.default(C[ind, ind]) : Lapack routine dgesv: system is exactly singular. Any help is appreciated. Ying library(sem) R.pw <- matrix(c( 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2137356, 0.2137356, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.09792217, 0.09792217, -0.2361812, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.09792217, 0.09792217, -0.2361812, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.3416128, -0.3416128, -0.1119895, 0.2010699, 0.2010699, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3376722, 0.3376722, 0.4047681, 0.2336768, 0.2336768, -0.03834732, 1, 0, 0, 0, 0, 0, 0, 0, 0, -0.2839319, -0.2839319, -0.3629782, 0.3984223, 0.3984223, 0.05373268, -0.1654119, 1, 0, 0, 0, 0, 0, 0, 0, 0.2310275, 0.2310275, -0.4024943, 0.2300232, 0.2300232, 0.03810058, -0.01643857, 0.07035818, 1, 0, 0, 0, 0, 0, 0, -0.04056463, -0.04056463, 0.002349133, 0.06147696, 0.06147696, 0.06807565, 0.1738111, -0.2608123, 0.04999732, 1, 0, 0, 0, 0, 0, 0.1144722, 0.1144722, 0.2017593, -0.2486019, -0.2486019, -0.005331486, 0.1210839, -0.1210703, -0.1725961, -0.1427469, 1, 0, 0, 0, 0, 0.2982168, 0.2982168, 0.1301404, -0.4791305, -0.4791305, -0.4438671, -0.2434473, -0.2764221, -0.04376478, -0.1035696, 0.1645827, 1, 0, 0, 0, -0.06369212, -0.06369212, -0.5104676, -0.02605288, -0.02605288, 0.07798648, -0.4108327, 0.4070634, 0.3604693, 0.002472274, 0.07678578, 0.06634956, 1, 0, 0, 0.2269556, 0.2269556, -0.3010457, 0.1114584, 0.1114584, -0.1257139, -0.1877948, 0.2157421, 0.2154363, -0.1412916, -0.137988, 0.1565902, 0.344611, 1, 0, 0.2269556, 0.2269556, -0.3010457, 0.1114584, 0.1114584, -0.1257139, -0.1877948, 0.2157421, 0.2154363, -0.1412916, -0.137988, 0.1565902, 0.344611, 1, 1 ), ncol=15, byrow=TRUE) R.pw model.pw <- matrix(c( 'A_9568 -> A_9569', 'x1', NA, 'A_9569 -> M_20044', 'x2', NA, 'A_9569 -> M_20048_36', 'x3', NA, 'A_9570 -> M_20044', 'x4', NA, 'A_9570 -> M_20048_36', 'x5', NA, 'A_9571 -> M_20044', 'x6', NA, 'A_9571 -> M_20048_36', 'x7', NA, 'M_20044_P -> M_20199', 'x8', NA, 'M_20045_P -> M_21185', 'x9', NA, 'M_20048_P -> M_20199', 'x11', NA, 'M_20199 -> A_9569', 'x12', NA, 'M_20199 -> A_9570', 'x13', NA, 'M_20199 -> A_9571', 'x14', NA, 'M_20209_26_5569 -> M_20113', 'x15', NA, 'M_20209_26_5569 -> M_20225', 'x16', NA, 'M_20209_26_5569 -> M_20230', 'x17', NA, 'M_20209_26_5569 -> M_20330', 'x18', NA, 'M_20215 -> A_9571', 'x19', NA, 'M_20225 -> A_9568', 'x20', NA, 'M_20230 -> A_9569', 'x21', NA, 'M_20230 -> A_9570', 'x22', NA, 'M_20287 -> A_9568', 'x23', NA, 'M_20288 -> A_9568', 'x24', NA, 'M_21183 -> A_9568', 'x25', NA, 'M_21183_P -> M_21185', 'x26', NA, 'M_21185 -> A_9570', 'x27', NA, 'A_9568 <-> A_9568', 'x28', 'NA', 'A_9569 <-> A_9569', 'x29', 'NA', 'A_9570 <-> A_9570', 'x30', 'NA', 'A_9571 <-> A_9571', 'x31', 'NA', 'M_20044 <-> M_20044', 'x32', 'NA', 'M_20044_P <-> M_20044_P', 'x33', 'NA', 'M_20045_P <-> M_20045_P', 'x34', 'NA', 'M_20048_36 <-> M_20048_36', 'x36', 'NA', 'M_20048_P <-> M_20048_P', 'x37', 'NA', 'M_20113 <-> M_20113', 'x38', 'NA', 'M_20199 <-> M_20199', 'x39', 'NA', 'M_20209_26_5569 <-> M_20209_26_5569', 'x40', 'NA', 'M_20215 <-> M_20215', 'x41', 'NA', 'M_20225 <-> M_20225', 'x42', 'NA', 'M_20230 <-> M_20230', 'x43', 'NA', 'M_20287 <-> M_20287', 'x44', 'NA', 'M_20288 <-> M_20288', 'x45', 'NA', 'M_20330 <-> M_20330', 'x46', 'NA', 'M_21183 <-> M_21183', 'x47', 'NA', 'M_21183_P <-> M_21183_P', 'x48', 'NA', 'M_21185 <-> M_21185', 'x49', 'NA'), ncol=3, byrow=TRUE) model.pw rownames(R.pw) <- colnames(R.pw) <- c( 'M_20044', 'M_20044_P', 'M_20045_P', 'M_20048_36', 'M_20048_P', 'M_20113', 'M_20209_26_5569', 'M_20215', 'M_20225', 'M_20230', 'M_20287', 'M_20288', 'M_20330', 'M_21183', 'M_21183_P') R.pw obs.vars=rownames(R.pw) obs.vars sem.pw <- sem(model.pw, R.pw, 330, obs.vars=rownames(R.pw), fixed.x=NULL, debug=T) sem.pw summary(sem.pw) [[alternative HTML version deleted]]