因子分析未分配给对象

时间:2019-05-14 16:04:51

标签: r

我正在进行探索性因素分析,并指定将因素分析结果加载到f2中。

我的代码如下。第一行运行,但是当我运行我的下一行代码(引用f2)时,出现一条消息“未找到对象'f2'”。

因此,该分配无法正常工作。我是否真的缺少明显的东西?因素分析使用心理软件包。我已经检查了文档及其示例,它们相似地为对象提供了因素分配分析结果,因此我有些困惑。任何指针将不胜感激。

f2 <- fa(MDI, nfactors = 30, n.obs = 286, rotation = "promax", min.err = 0.001, 
         fm = "wls", cor = "poly")
load = loadings(f2)
print(load, sort = TRUE, digits = 2, cutoff = 0.001)                   
plot(load)                                                                      
identify(load, labels = names(MDI))    
plot(f2, labels = names(MDI))

下面是相关矩阵的dput,因此可以重现。

> dput(MDI)
structure(list(X = structure(c(1L, 12L, 23L, 25L, 26L, 27L, 28L, 
29L, 30L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 13L, 14L, 
15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 24L), .Label = c("mdi1", 
"mdi10", "mdi11", "mdi12", "mdi13", "mdi14", "mdi15", "mdi16", 
"mdi17", "mdi18", "mdi19", "mdi2", "mdi20", "mdi21", "mdi22", 
"mdi23", "mdi24", "mdi25", "mdi26", "mdi27", "mdi28", "mdi29", 
"mdi3", "mdi30", "mdi4", "mdi5", "mdi6", "mdi7", "mdi8", "mdi9"
), class = "factor"), mdi1 = c(1, 0.3936173, 0.4689895, 0.3723157, 
0.5000249, 0.4007723, 0.4752565, 0.3299713, 0.4467554, 0.3092035, 
0.4587867, 0.3502716, 0.4765846, 0.4296331, 0.4279444, 0.3978138, 
0.3130349, 0.4217768, 0.4217768, 0.3941672, 0.442678, 0.4143811, 
0.4883476, 0.3818616, 0.4253592, 0.4220679, 0.3341886, 0.2904774, 
0.4125257, 0.471747), mdi2 = c(0.3936173, 1, 0.5687221, 0.5503958, 
0.3579519, 0.5524491, 0.4113922, 0.5692459, 0.5244077, 0.4519596, 
0.4691271, 0.3328134, 0.3909096, 0.5207473, 0.517872, 0.4460308, 
0.5357907, 0.5271745, 0.5656711, 0.6416844, 0.5933588, 0.5301733, 
0.4632707, 0.3692169, 0.3899222, 0.6722428, 0.571866, 0.4770556, 
0.4447538, 0.4801506), mi3 = c(0.4689895, 0.5687221, 1, 0.5337568, 
0.4605771, 0.5801225, 0.4748034, 0.5027398, 0.6493962, 0.4371995, 
0.4814276, 0.5174168, 0.4575024, 0.5161417, 0.7302354, 0.443922, 
0.4503891, 0.6403537, 0.4638545, 0.5755256, 0.6559644, 0.5669309, 
0.4882669, 0.540937, 0.4305827, 0.6208696, 0.5774123, 0.4337106, 
0.5007241, 0.5812161), mdi4 = c(0.3723157, 0.5503958, 0.5337568, 
1, 0.4647914, 0.5432398, 0.5222107, 0.480119, 0.5095777, 0.6127156, 
0.5411, 0.3438971, 0.5132041, 0.4708869, 0.5773365, 0.640864, 
0.5419371, 0.4278067, 0.4294387, 0.5762886, 0.6173602, 0.696368, 
0.4768973, 0.4312955, 0.4800561, 0.4966285, 0.4940535, 0.6449681, 
0.4448795, 0.4511662), mdi5 = c(0.5000249, 0.3579519, 0.4605771, 
0.4647914, 1, 0.529076, 0.4627546, 0.4322669, 0.5266816, 0.4193437, 
0.5274925, 0.355744, 0.4748984, 0.3943626, 0.5452649, 0.4282942, 
0.3884295, 0.4405988, 0.5013351, 0.4372788, 0.5033538, 0.449599, 
0.4719872, 0.5221968, 0.4572666, 0.478281, 0.4474777, 0.436465, 
0.6423572, 0.5367758), mdi6 = c(0.4007723, 0.5524491, 0.5801225, 
0.5432398, 0.529076, 1, 0.5481986, 0.5292259, 0.554901, 0.5197566, 
0.6618723, 0.7776074, 0.5538152, 0.5513789, 0.6005339, 0.5479274, 
0.5154317, 0.7863542, 0.5508043, 0.6893594, 0.5754793, 0.6092226, 
0.5590816, 0.7415316, 0.5702535, 0.7306869, 0.6161738, 0.5381451, 
0.5487092, 0.7739138), mdi7 = c(0.4752565, 0.4113922, 0.4748034, 
0.5222107, 0.4627546, 0.5481986, 1, 0.4208138, 0.5818144, 0.5123467, 
0.5154297, 0.5182619, 0.6342495, 0.5054629, 0.5154232, 0.550466, 
0.4921495, 0.4687262, 0.4268752, 0.56955, 0.5046245, 0.5563658, 
0.544639, 0.4961694, 0.6133689, 0.5084869, 0.4299369, 0.5220904, 
0.4294706, 0.4739928), mdi8 = c(0.3299713, 0.5692459, 0.5027398, 
0.480119, 0.4322669, 0.5292259, 0.4208138, 1, 0.5723092, 0.3119612, 
0.4675261, 0.3380419, 0.353584, 0.4541021, 0.5421594, 0.474245, 
0.6079999, 0.5235899, 0.5335896, 0.4957257, 0.5442768, 0.4974862, 
0.5023641, 0.4025193, 0.4116167, 0.5727691, 0.6270551, 0.4208924, 
0.5064872, 0.4869765), mdi9 = c(0.4467554, 0.5244077, 0.6493962, 
0.5095777, 0.5266816, 0.554901, 0.5818144, 0.5723092, 1, 0.490689, 
0.5181651, 0.4850319, 0.5356553, 0.6158338, 0.6559043, 0.5307519, 
0.5871398, 0.5846594, 0.5470594, 0.6284931, 0.6879265, 0.6163574, 
0.512804, 0.5047779, 0.5466345, 0.613476, 0.5883362, 0.506302, 
0.4979364, 0.5808664), mdi10 = c(0.3092035, 0.4519596, 0.4371995, 
0.6127156, 0.4193437, 0.5197566, 0.5123467, 0.3119612, 0.490689, 
1, 0.5118569, 0.4462334, 0.4532171, 0.4315306, 0.4522421, 0.7588315, 
0.4401081, 0.4350122, 0.4499751, 0.5206525, 0.5352926, 0.6998865, 
0.4755847, 0.4100334, 0.4787971, 0.453012, 0.4734884, 0.7813307, 
0.535401, 0.4395691), mdi11 = c(0.4587867, 0.4691271, 0.4814276, 
0.5411, 0.5274925, 0.6618723, 0.5154297, 0.4675261, 0.5181651, 
0.5118569, 1, 0.5527827, 0.501612, 0.5149324, 0.540138, 0.5069535, 
0.528538, 0.579202, 0.5901564, 0.5299329, 0.5250493, 0.5154014, 
0.5127527, 0.5788864, 0.5161334, 0.507289, 0.5158013, 0.5344951, 
0.5978617, 0.647102), mdi12 = c(0.3502716, 0.3328134, 0.5174168, 
0.3438971, 0.355744, 0.7776074, 0.5182619, 0.3380419, 0.4850319, 
0.4462334, 0.5527827, 1, 0.5154903, 0.4620118, 0.472202, 0.4547294, 
0.4840607, 0.8285936, 0.5358637, 0.5490359, 0.4616615, 0.4249117, 
0.4808445, 0.7267043, 0.552395, 0.5925844, 0.4751664, 0.3929154, 
0.4023344, 0.6972608), mdi13 = c(0.4765846, 0.3909096, 0.4575024, 
0.5132041, 0.4748984, 0.5538152, 0.6342495, 0.353584, 0.5356553, 
0.4532171, 0.501612, 0.5154903, 1, 0.517566, 0.5669901, 0.4811508, 
0.4159442, 0.5916418, 0.5317423, 0.6019275, 0.5150589, 0.6103914, 
0.7036702, 0.5396378, 0.7106897, 0.5663952, 0.4743636, 0.5357141, 
0.4997759, 0.5310849), mdi14 = c(0.4296331, 0.5207473, 0.5161417, 
0.4708869, 0.3943626, 0.5513789, 0.5054629, 0.4541021, 0.6158338, 
0.4315306, 0.5149324, 0.4620118, 0.517566, 1, 0.5294991, 0.4641652, 
0.5595265, 0.5568292, 0.5329007, 0.6300983, 0.5476386, 0.6433976, 
0.5124435, 0.5178623, 0.4634521, 0.6025023, 0.4958374, 0.4741311, 
0.4363587, 0.5922855), mdi15 = c(0.4279444, 0.517872, 0.7302354, 
0.5773365, 0.5452649, 0.6005339, 0.5154232, 0.5421594, 0.6559043, 
0.4522421, 0.540138, 0.472202, 0.5669901, 0.5294991, 1, 0.4969139, 
0.5407898, 0.711619, 0.5776979, 0.6465131, 0.8102714, 0.6210396, 
0.5843541, 0.5708951, 0.5353925, 0.6430862, 0.6773275, 0.5256203, 
0.5525755, 0.5968413), mdi16 = c(0.3978138, 0.4460308, 0.443922, 
0.640864, 0.4282942, 0.5479274, 0.550466, 0.474245, 0.5307519, 
0.7588315, 0.5069535, 0.4547294, 0.4811508, 0.4641652, 0.4969139, 
1, 0.5327385, 0.4919386, 0.4640105, 0.6189401, 0.6221125, 0.7849677, 
0.5263167, 0.4961512, 0.546515, 0.4792591, 0.5387354, 0.7593365, 
0.5443296, 0.4965095), mdi17 = c(0.3130349, 0.5357907, 0.4503891, 
0.5419371, 0.3884295, 0.5154317, 0.4921495, 0.6079999, 0.5871398, 
0.4401081, 0.528538, 0.4840607, 0.4159442, 0.5595265, 0.5407898, 
0.5327385, 1, 0.5972664, 0.6531257, 0.6124992, 0.6593416, 0.5779083, 
0.54295, 0.5091556, 0.4999436, 0.5534753, 0.6906962, 0.5515724, 
0.5763667, 0.5257787), mdi18 = c(0.4217768, 0.5271745, 0.6403537, 
0.4278067, 0.4405988, 0.7863542, 0.4687262, 0.5235899, 0.5846594, 
0.4350122, 0.579202, 0.8285936, 0.5916418, 0.5568292, 0.711619, 
0.4919386, 0.5972664, 1, 0.616892, 0.6776108, 0.653145, 0.6462477, 
0.6133169, 0.76014, 0.5693621, 0.7255007, 0.6772965, 0.4731968, 
0.6136029, 0.8215128), mdi19 = c(0.4217768, 0.5656711, 0.4638545, 
0.4294387, 0.5013351, 0.5508043, 0.4268752, 0.5335896, 0.5470594, 
0.4499751, 0.5901564, 0.5358637, 0.5317423, 0.5329007, 0.5776979, 
0.4640105, 0.6531257, 0.616892, 1, 0.6277485, 0.5888859, 0.5781749, 
0.5962161, 0.4966702, 0.525626, 0.5893053, 0.5937545, 0.4536458, 
0.6023978, 0.595442), mdi20 = c(0.3941672, 0.6416844, 0.5755256, 
0.5762886, 0.4372788, 0.6893594, 0.56955, 0.4957257, 0.6284931, 
0.5206525, 0.5299329, 0.5490359, 0.6019275, 0.6300983, 0.6465131, 
0.6189401, 0.6124992, 0.6776108, 0.6277485, 1, 0.7456018, 0.7237394, 
0.5914482, 0.6174089, 0.6084753, 0.7583413, 0.6222094, 0.6093335, 
0.5607048, 0.6734581), mdi21 = c(0.442678, 0.5933588, 0.6559644, 
0.6173602, 0.5033538, 0.5754793, 0.5046245, 0.5442768, 0.6879265, 
0.5352926, 0.5250493, 0.4616615, 0.5150589, 0.5476386, 0.8102714, 
0.6221125, 0.6593416, 0.653145, 0.5888859, 0.7456018, 1, 0.6836611, 
0.5767896, 0.5020915, 0.5302819, 0.6788499, 0.7302629, 0.5532899, 
0.514876, 0.5369505), mdi22 = c(0.4143811, 0.5301733, 0.5669309, 
0.696368, 0.449599, 0.6092226, 0.5563658, 0.4974862, 0.6163574, 
0.6998865, 0.5154014, 0.4249117, 0.6103914, 0.6433976, 0.6210396, 
0.7849677, 0.5779083, 0.6462477, 0.5781749, 0.7237394, 0.6836611, 
1, 0.6970878, 0.5551017, 0.5309829, 0.669629, 0.618117, 0.7725701, 
0.5368407, 0.6161932), mdi23 = c(0.4883476, 0.4632707, 0.4882669, 
0.4768973, 0.4719872, 0.5590816, 0.544639, 0.5023641, 0.512804, 
0.4755847, 0.5127527, 0.4808445, 0.7036702, 0.5124435, 0.5843541, 
0.5263167, 0.54295, 0.6133169, 0.5962161, 0.5914482, 0.5767896, 
0.6970878, 1, 0.5780347, 0.5722519, 0.6007872, 0.6153544, 0.579486, 
0.5826146, 0.5400445), mdi24 = c(0.3818616, 0.3692169, 0.540937, 
0.4312955, 0.5221968, 0.7415316, 0.4961694, 0.4025193, 0.5047779, 
0.4100334, 0.5788864, 0.7267043, 0.5396378, 0.5178623, 0.5708951, 
0.4961512, 0.5091556, 0.76014, 0.4966702, 0.6174089, 0.5020915, 
0.5551017, 0.5780347, 1, 0.5823804, 0.6163705, 0.5893418, 0.4599374, 
0.4879448, 0.7233099), mdi25 = c(0.4253592, 0.3899222, 0.4305827, 
0.4800561, 0.4572666, 0.5702535, 0.6133689, 0.4116167, 0.5466345, 
0.4787971, 0.5161334, 0.552395, 0.7106897, 0.4634521, 0.5353925, 
0.546515, 0.4999436, 0.5693621, 0.525626, 0.6084753, 0.5302819, 
0.5309829, 0.5722519, 0.5823804, 1, 0.6287262, 0.4351833, 0.541565, 
0.488426, 0.5750416), mdi26 = c(0.4220679, 0.6722428, 0.6208696, 
0.4966285, 0.478281, 0.7306869, 0.5084869, 0.5727691, 0.613476, 
0.453012, 0.507289, 0.5925844, 0.5663952, 0.6025023, 0.6430862, 
0.4792591, 0.5534753, 0.7255007, 0.5893053, 0.7583413, 0.6788499, 
0.669629, 0.6007872, 0.6163705, 0.6287262, 1, 0.6485229, 0.6028357, 
0.5814636, 0.6474577), mdi27 = c(0.3341886, 0.571866, 0.5774123, 
0.4940535, 0.4474777, 0.6161738, 0.4299369, 0.6270551, 0.5883362, 
0.4734884, 0.5158013, 0.4751664, 0.4743636, 0.4958374, 0.6773275, 
0.5387354, 0.6906962, 0.6772965, 0.5937545, 0.6222094, 0.7302629, 
0.618117, 0.6153544, 0.5893418, 0.4351833, 0.6485229, 1, 0.5630586, 
0.5338222, 0.5340758), mdi28 = c(0.2904774, 0.4770556, 0.4337106, 
0.6449681, 0.436465, 0.5381451, 0.5220904, 0.4208924, 0.506302, 
0.7813307, 0.5344951, 0.3929154, 0.5357141, 0.4741311, 0.5256203, 
0.7593365, 0.5515724, 0.4731968, 0.4536458, 0.6093335, 0.5532899, 
0.7725701, 0.579486, 0.4599374, 0.541565, 0.6028357, 0.5630586, 
1, 0.5835477, 0.5081215), mdi29 = c(0.4125257, 0.4447538, 0.5007241, 
0.4448795, 0.6423572, 0.5487092, 0.4294706, 0.5064872, 0.4979364, 
0.535401, 0.5978617, 0.4023344, 0.4997759, 0.4363587, 0.5525755, 
0.5443296, 0.5763667, 0.6136029, 0.6023978, 0.5607048, 0.514876, 
0.5368407, 0.5826146, 0.4879448, 0.488426, 0.5814636, 0.5338222, 
0.5835477, 1, 0.611525), mdi30 = c(0.471747, 0.4801506, 0.5812161, 
0.4511662, 0.5367758, 0.7739138, 0.4739928, 0.4869765, 0.5808664, 
0.4395691, 0.647102, 0.6972608, 0.5310849, 0.5922855, 0.5968413, 
0.4965095, 0.5257787, 0.8215128, 0.595442, 0.6734581, 0.5369505, 
0.6161932, 0.5400445, 0.7233099, 0.5750416, 0.6474577, 0.5340758, 
0.5081215, NA, 1)), class = "data.frame", row.names = c(NA, -30L
))

我能够将原始数据用作MDI的输入,并且因错误消息而运行了因子分析(在下面的评论中,因此这篇文章不会太长)。实际的数据集确实很大,但是我从中创建了一个较小的数据集,在运行因子分析时会生成相同的错误消息。该较小数据集的计算结果如下。

>dput(MDI)
structure(list(MDIdisengagement = c(2L, 1L, 1L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 2L, 0L, 1L, 3L, 
1L, 4L, 2L, 0L, 1L, 0L, 2L, 4L, 2L, 0L, 0L, 1L, 1L, 0L, 2L, 1L, 
1L, 1L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 1L, 1L, 0L, 2L, 0L, 0L, 0L, 
1L, 4L, 1L, 0L, 3L, 2L, 1L, 0L, 0L, 2L, 0L, 1L, 1L, 2L, 4L, 7L, 
0L, 0L, 0L, 1L, 3L, 0L, 2L, 0L, 7L, 0L, 4L, 0L, 1L, 0L, 0L, 0L, 
1L, 1L, 1L, 2L, 2L, 0L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 
0L, 0L, 0L, 3L, 2L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 0L, 0L, 0L, 2L, 
0L, 4L, 2L, 4L, 2L, 3L, 1L, 1L, 2L, 4L, 3L, 0L, 2L, 4L, 1L, 1L, 
1L, 0L, 1L, 0L, 1L, 3L, 1L, 4L, 1L, 1L, 2L, 4L, 3L, 0L, 1L, 0L, 
1L, 0L, 0L, 2L, 0L, 0L, 1L, 1L, 3L, 1L, 0L, 1L, 2L, 4L, 2L, 1L, 
1L, 2L, 3L, 1L, 1L, 0L, 1L, 1L, 0L, 0L, 4L, 2L, 0L, 2L, 0L, 1L, 
0L, 2L, 4L, 0L, 2L, 0L, 2L, 2L, 4L, 0L, 0L, 1L, 1L, 2L, 2L, 2L, 
1L, 1L, 2L, 3L, 0L, 2L, 0L, 1L, 3L, 7L, 1L, 2L, 2L, 0L, 0L, 3L,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4L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 
2L, 0L, 0L, 3L, 1L, 0L, 0L, 4L, 0L, 0L, 0L, 0L, 4L, 0L, 0L, 2L, 
0L, 0L)), class = "data.frame", row.names = c(NA, -291L))

1 个答案:

答案 0 :(得分:0)

致电fa时遇到一些问题。首先,您需要删除X列以提供适当的相关矩阵。这对您来说可能不是问题,但当然是您的dput示例。但是,即使在解决此问题后,主要问题仍然是调用多态相关。如果要指定cor = "poly",则需要使用离散数据。

我建议您使用仅包含测量变量且不包含X之类的额外变量的离散数据来运行对fa的调用。如果仍然遇到错误,请更新示例以包含离散数据我会尽力帮助您。

编辑:所以现在您的大问题是您只有6个项目,并且在因素分析中,通常每个因素至少需要三个项目,在您的情况下,您最多只能留有2个因素,但即使这样做也是如此。使用nfactors=1可以使用,但是不能使用nfactors>1来查看为什么会出现问题,您可以像下面这样查看相关矩阵的特征值:

eigen(polychoric(MDI)$rho)

这将产生以下输出:

$values
[1] 4.76730952 0.68445132 0.28440838 0.18855401 0.05141578 0.02386099

如您所见,几乎所有的方差都由第一个因素解释,之后几乎没有。因此,在尝试提取多个因素时出现错误并不奇怪。屏幕上会显示一个碎石图。

所以这可以工作,但是结果可能不是很有趣:

f2 <- fa(MDI,nfactors=1,rotation="promax", min.err= 0.001, fm="wls", cor="poly")

这有意义吗?