Wolfgang Pauli
2004-Mar-13 16:56 UTC
[R] ... Error in "names<-.default"(`*tmp*`, value = nmstrata)
Hi, OK, I will describe it in more detail.In the meantime I installed the newest debian package of r-base etc. and the error message changed from:Error in "names<-.default"(`*tmp*`, value = nmstrata) : names attribute must be the same length as the vectorto:Error model is singular in: aov(rati ~ cs * spk + Error(sub/(cs * spk)), data = rating.df) The model is a repeated measures anova that's why I use the Error() term. I found the hint for this usage in "Notes on the use of R for psychology experiments and questionaires" (Jonathan Baron, 2003).cs and speaker are within-subjects factors. rati is the dependent variable: ratings done by subjects. sub are the subject-codes (between-subjects factor). SpaeVP is sorted because in the preprocessing I needed to recoded data of each subject and did:>testfac <- as.factor(spaeVP)>levels(testfac) -> vpnso I could do "for ( i in vpn)".after that data (rati) was sorted so I sorted spaeVp too, before putting it into the dataframe. (I found no better solution (newbie))Now follows the syntax I already sent last time. After that is more data of my dataframe. with best regards, Wolfgang Pauli I use:spk =factor(rep(c("spk1","spk2","spk3","spk4","spk5","spk6","spk7","spk8"), c(2,2,2,2,2,2,2,2)))cs = factor(rep(c("yes","no"),c(8,8)))sub = factor(sort(spaeVP))rati = stack(data.frame(arousal))rati = rati[,1]rating.df <- data.frame(sub, cs, spk, rati)summary(aov(rati ~ cs*spk + Error(sub/(cs*spk)), data=rating.df))> arousal (30 subjects, and 16 stimuli) before using stack() and putting it into "rati" [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] -1 -2 -1 -1 -2 0 -1 0 -2 -1 0 0 -2 [2,] 0 0 0 0 -1 1 0 -1 -2 0 1 -1 -1 [3,] 1 -1 -1 -2 -1 0 0 0 -3 0 -1 0 2 [4,] 0 0 2 0 -1 1 0 1 0 2 -2 1 -2 [5,] 0 0 -1 -1 -1 0 0 0 0 0 1 0 1 [6,] -1 0 -2 0 -2 0 0 0 0 0 -1 1 0 [7,] -1 0 0 0 -1 0 0 -1 0 1 -1 1 -1 [8,] 1 0 0 0 -1 0 0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 1 -2 0 0 -2 1 0 [9,] -2 0 0 0 -3 1 0[10,] 2 -2 -1 -1 1 2 0[11,] -1 -1 -1 -1 1 1 2[12,] -1 0 0 0 -1 0 1[13,] -2 1 -1 -1 -2 2 0[14,] 0 -1 -1 0 0 2 2[15,] 1 -1 0 0 0 3 1[16,] 0 0 2 1 0 2 1>> rating.df sub cs spk rati1 5 yes spk1 -12 5 yes spk1 03 5 yes spk2 14 5 yes spk2 05 5 yes spk3 06 5 yes spk3 -17 5 yes spk4 -18 5 yes spk4 19 5 no spk5 010 5 no spk5 011 5 no spk6 012 5 no spk6 -113 5 no spk7 014 5 no spk7 115 5 no spk8 016 5 no spk8 117 6 yes spk1 -218 6 yes spk1 019 6 yes spk2 -120 6 yes spk2 021 6 yes spk3 022 6 yes spk3 023 6 yes spk4 024 6 yes spk4 025 6 no spk5 -126 6 no spk5 -227 6 no spk6 -128 6 no spk6 -329 6 no spk7 -130 6 no spk7 231 6 no spk8 032 6 no spk8 033 7 yes spk1 -134 7 yes spk1 035 7 yes spk2 -136 7 yes spk2 237 7 yes spk3 -138 7 yes spk3 -239 7 yes spk4 040 7 yes spk4 041 7 no spk5 042 7 no spk5 -143 7 no spk6 044 7 no spk6 045 7 no spk7 -146 7 no spk7 247 7 no spk8 048 7 no spk8 -249 8 yes spk1 -150 8 yes spk1 051 8 yes spk2 -252 8 yes spk2 053 8 yes spk3 -154 8 yes spk3 055 8 yes spk4 056 8 yes spk4 057 8 no spk5 058 8 no spk5 -159 8 no spk6 060 8 no spk6 -261 8 no spk7 -162 8 no spk7 -163 8 no spk8 -164 8 no spk8 -165 9 yes spk1 -266 9 yes spk1 -167 9 yes spk2 -168 9 yes spk2 -169 9 yes spk3 -170 9 yes spk3 -271 9 yes spk4 -172 9 yes spk4 -173 9 no spk5 -174 9 no spk5 075 9 no spk6 076 9 no spk6 077 9 no spk7 078 9 no spk7 079 9 no spk8 080 9 no spk8 081 10 yes spk1 082 10 yes spk1 183 10 yes spk2 084 10 yes spk2 185 10 yes spk3 086 10 yes spk3 087 10 yes spk4 088 10 yes spk4 089 10 no spk5 090 10 no spk5 291 10 no spk6 -192 10 no spk6 093 10 no spk7 -194 10 no spk7 095 10 no spk8 196 10 no spk8 -197 11 yes spk1 -198 11 yes spk1 099 11 yes spk2 0100 11 yes spk2 0101 11 yes spk3 0102 11 yes spk3 0103 11 yes spk4 0104 11 yes spk4 0105 11 no spk5 0106 11 no spk5 0107 11 no spk6 -1108 11 no spk6 0109 11 no spk7 0110 11 no spk7 0111 11 no spk8 -1112 11 no spk8 0113 12 yes spk1 0114 12 yes spk1 -1115 12 yes spk2 0116 12 yes spk2 1117 12 yes spk3 0118 12 yes spk3 0119 12 yes spk4 -1120 12 yes spk4 1121 12 no spk5 1122 12 no spk5 -2123 12 no spk6 0124 12 no spk6 0125 12 no spk7 -1126 12 no spk7 0127 12 no spk8 -1128 12 no spk8 0129 13 yes spk1 -2130 13 yes spk1 -2131 13 yes spk2 -3132 13 yes spk2 0133 13 yes spk3 0134 13 yes spk3 0135 13 yes spk4 0136 13 yes spk4 0137 13 no spk5 0138 13 no spk5 -2139 13 no spk6 -1140 13 no spk6 -1141 13 no spk7 -1142 13 no spk7 1143 13 no spk8 -1144 13 no spk8 -1145 14 yes spk1 -1146 14 yes spk1 0147 14 yes spk2 0148 14 yes spk2 2149 14 yes spk3 0150 14 yes spk3 0151 14 yes spk4 1152 14 yes spk4 -1153 14 no spk5 -1154 14 no spk5 1155 14 no spk6 -1156 14 no spk6 0157 14 no spk7 -1158 14 no spk7 -1159 14 no spk8 0160 14 no spk8 1161 16 yes spk1 0162 16 yes spk1 1163 16 yes spk2 -1164 16 yes spk2 -2165 16 yes spk3 1166 16 yes spk3 -1167 16 yes spk4 -1168 16 yes spk4 -3169 16 no spk5 0170 16 no spk5 -1171 16 no spk6 1172 16 no spk6 1173 16 no spk7 -1174 16 no spk7 0175 16 no spk8 -1176 16 no spk8 1177 17 yes spk1 0178 17 yes spk1 -1179 17 yes spk2 0180 17 yes spk2 1181 17 yes spk3 0182 17 yes spk3 1183 17 yes spk4 1184 17 yes spk4 0185 17 no spk5 1186 17 no spk5 2187 17 no spk6 1188 17 no spk6 2189 17 no spk7 1190 17 no spk7 1191 17 no spk8 -2192 17 no spk8 1193 19 yes spk1 -2194 19 yes spk1 -1195 19 yes spk2 2196 19 yes spk2 -2197 19 yes spk3 1198 19 yes spk3 0199 19 yes spk4 -1200 19 yes spk4 1201 19 no spk5 3202 19 no spk5 1203 19 no spk6 0204 19 no spk6 1205 19 no spk7 0206 19 no spk7 1207 19 no spk8 1208 19 no spk8 0209 20 yes spk1 0210 20 yes spk1 -2211 20 yes spk2 1212 20 yes spk2 2213 20 yes spk3 -2214 20 yes spk3 0215 20 yes spk4 0216 20 yes spk4 1217 20 no spk5 1218 20 no spk5 1219 20 no spk6 0220 20 no spk6 1221 20 no spk7 2222 20 no spk7 -1223 20 no spk8 2224 20 no spk8 0225 23 yes spk1 0226 23 yes spk1 0227 23 yes spk2 0228 23 yes spk2 0229 23 yes spk3 1230 23 yes spk3 1231 23 yes spk4 1232 23 yes spk4 0233 23 no spk5 0234 23 no spk5 0235 23 no spk6 -1236 23 no spk6 1237 23 no spk7 0238 23 no spk7 0239 23 no spk8 0240 23 no spk8 0241 24 yes spk1 0242 24 yes spk1 -1243 24 yes spk2 0244 24 yes spk2 1245 24 yes spk3 -1246 24 yes spk3 -1247 24 yes spk4 1248 24 yes spk4 0249 24 no spk5 -2250 24 no spk5 0251 24 no spk6 1252 24 no spk6 0253 24 no spk7 -1254 24 no spk7 -1255 24 no spk8 0256 24 no spk8 0257 25 yes spk1 0258 25 yes spk1 -1259 25 yes spk2 0260 25 yes spk2 0261 25 yes spk3 1262 25 yes spk3 0263 25 yes spk4 0264 25 yes spk4 -2265 25 no spk5 0266 25 no spk5 0267 25 no spk6 1268 25 no spk6 1269 25 no spk7 1270 25 no spk7 2271 25 no spk8 -2272 25 no spk8 1273 27 yes spk1 0274 27 yes spk1 1275 27 yes spk2 1276 27 yes spk2 0277 27 yes spk3 0278 27 yes spk3 -1279 27 yes spk4 0280 27 yes spk4 0281 27 no spk5 0282 27 no spk5 0283 27 no spk6 0284 27 no spk6 -1285 27 no spk7 -1286 27 no spk7 -1287 27 no spk8 -2288 27 no spk8 0289 28 yes spk1 0290 28 yes spk1 -3291 28 yes spk2 -2292 28 yes spk2 0293 28 yes spk3 -2294 28 yes spk3 -2295 28 yes spk4 -1296 28 yes spk4 0297 28 no spk5 -2298 28 no spk5 -1299 28 no spk6 0300 28 no spk6 -1301 28 no spk7 -3302 28 no spk7 -1303 28 no spk8 0304 28 no spk8 -1305 91 yes spk1 1306 91 yes spk1 3307 91 yes spk2 0308 91 yes spk2 3309 91 yes spk3 1310 91 yes spk3 3311 91 yes spk4 0312 91 yes spk4 -2313 91 no spk5 2314 91 no spk5 1315 91 no spk6 0316 91 no spk6 1317 91 no spk7 4318 91 no spk7 1319 91 no spk8 0320 91 no spk8 1321 92 yes spk1 1322 92 yes spk1 0323 92 yes spk2 -1324 92 yes spk2 -1325 92 yes spk3 0326 92 yes spk3 3327 92 yes spk4 1328 92 yes spk4 1329 92 no spk5 2330 92 no spk5 1331 92 no spk6 1332 92 no spk6 2333 92 no spk7 1334 92 no spk7 0335 92 no spk8 2336 92 no spk8 0337 93 yes spk1 0338 93 yes spk1 0339 93 yes spk2 -1340 93 yes spk2 1341 93 yes spk3 0342 93 yes spk3 2343 93 yes spk4 -1344 93 yes spk4 1345 93 no spk5 0346 93 no spk5 0347 93 no spk6 -2348 93 no spk6 0349 93 no spk7 0350 93 no spk7 -1351 93 no spk8 2352 93 no spk8 1353 94 yes spk1 0354 94 yes spk1 -1355 94 yes spk2 0356 94 yes spk2 0357 94 yes spk3 0358 94 yes spk3 0359 94 yes spk4 1360 94 yes spk4 0361 94 no spk5 1362 94 no spk5 1363 94 no spk6 1364 94 no spk6 1365 94 no spk7 1366 94 no spk7 1367 94 no spk8 2368 94 no spk8 1369 96 yes spk1 1370 96 yes spk1 0371 96 yes spk2 0372 96 yes spk2 -1373 96 yes spk3 -1374 96 yes spk3 -1375 96 yes spk4 0376 96 yes spk4 0377 96 no spk5 0378 96 no spk5 1379 96 no spk6 0380 96 no spk6 0381 96 no spk7 -1382 96 no spk7 2383 96 no spk8 1384 96 no spk8 1385 97 yes spk1 1386 97 yes spk1 0387 97 yes spk2 -1388 97 yes spk2 0389 97 yes spk3 -1390 97 yes spk3 0391 97 yes spk4 0392 97 yes spk4 -1393 97 no spk5 0394 97 no spk5 2395 97 no spk6 1396 97 no spk6 0397 97 no spk7 -2398 97 no spk7 0399 97 no spk8 -1400 97 no spk8 -1401 98 yes spk1 0402 98 yes spk1 -2403 98 yes spk2 0404 98 yes spk2 1405 98 yes spk3 0406 98 yes spk3 0407 98 yes spk4 -1408 98 yes spk4 1409 98 no spk5 -2410 98 no spk5 2411 98 no spk6 -1412 98 no spk6 -1413 98 no spk7 -2414 98 no spk7 0415 98 no spk8 1416 98 no spk8 0417 99 yes spk1 -1418 99 yes spk1 -1419 99 yes spk2 0420 99 yes spk2 2421 99 yes spk3 0422 99 yes spk3 1423 99 yes spk4 -2424 99 yes spk4 -2425 99 no spk5 0426 99 no spk5 -2427 99 no spk6 -1428 99 no spk6 0429 99 no spk7 1430 99 no spk7 -1431 99 no spk8 -1432 99 no spk8 0433 911 yes spk1 -1434 911 yes spk1 -1435 911 yes spk2 -1436 911 yes spk2 0437 911 yes spk3 1438 911 yes spk3 -1439 911 yes spk4 -1440 911 yes spk4 0441 911 no spk5 0442 911 no spk5 -1443 911 no spk6 -1444 911 no spk6 0445 911 no spk7 -1446 911 no spk7 -1447 911 no spk8 0448 911 no spk8 2449 912 yes spk1 -1450 912 yes spk1 1451 912 yes spk2 -2452 912 yes spk2 1453 912 yes spk3 2454 912 yes spk3 0455 912 yes spk4 1456 912 yes spk4 0457 912 no spk5 0458 912 no spk5 -1459 912 no spk6 -1460 912 no spk6 0461 912 no spk7 -1462 912 no spk7 0463 912 no spk8 0464 912 no spk8 1465 914 yes spk1 -2466 914 yes spk1 0467 914 yes spk2 2468 914 yes spk2 -1469 914 yes spk3 -4470 914 yes spk3 -1471 914 yes spk4 0472 914 yes spk4 -2473 914 no spk5 -3474 914 no spk5 1475 914 no spk6 1476 914 no spk6 -1477 914 no spk7 -2478 914 no spk7 0479 914 no spk8 0480 914 no spk8 0481 919 yes spk1 0482 919 yes spk1 1483 919 yes spk2 -2484 919 yes spk2 0485 919 yes spk3 -2486 919 yes spk3 2487 919 yes spk4 -2488 919 yes spk4 1489 919 no spk5 1490 919 no spk5 2491 919 no spk6 1492 919 no spk6 0493 919 no spk7 2494 919 no spk7 2495 919 no spk8 3496 919 no spk8 2497 922 yes spk1 1498 922 yes spk1 2499 922 yes spk2 1500 922 yes spk2 1501 922 yes spk3 0502 922 yes spk3 0503 922 yes spk4 1504 922 yes spk4 0505 922 no spk5 0506 922 no spk5 0507 922 no spk6 2508 922 no spk6 1509 922 no spk7 0510 922 no spk7 2511 922 no spk8 1512 922 no spk8 1>