Normality test - Error in solve.default...

I am doing the normality test with the mshapiro.test function on several of my datasets. However, in some of them, I get this error:
"Error in solve.default(R %*% t(R), tol = 1e-18) : **
** system is computationally singular: reciprocal condition number = 7.19719e-20"

In this case, I don't know if I would have to invert the matrix or what procedure to follow. My matrix is : num [1:19, 1:12]. I would really appreciate if someone could help me solve this error.

Thank you in advance!! :slight_smile:

what package does that live in?

Corresponds to the mvnormtest package

It's hard to be specific without seeing your data, but probably you have columns that are exact linear combinations of one or more others, and this causes singularity error. Does that sound plausible given your data ?

It may be that, however, I am not entirely sure (I am a beginner in this field). If it is easier, I have no problem sending you the necessary information of the data to which I refer.

Ok. Use the dput() function.

Use triple backticks in the forum post to present it as code

```
This is code

Ok, is this:

structure(c(0.0083485491612552, 3.33856249069989e-05, 0.0688082819483789, 
0.0139228043404464, -0.0480500132118702, -0.0205334000493464, 
0.0219629945391609, -0.0211849862743369, -0.0392694865339741, 
-0.0255819529700528, 0.00611006927430406, -0.0537157240946075, 
0.0438061342554174, -0.0525792131279623, 0.00108143562241117, 
0.0290211232570956, 0.0145001252430065, 0.038946499424313, 0.0143733735714542, 
-0.00125349406126053, 0.00937492439972312, -0.0226174677849677, 
-0.00679696874038936, 0.00551565304464296, -0.00843687847603583, 
0.0176002818839682, 0.00336828891056302, 0.0173314874939019, 
0.0321178639686844, 0.00440535798489563, 0.0203399076469552, 
-0.0189200027720894, 0.0100981205032672, 0.0014248357079976, 
0.00563060126680371, -0.00634104704775902, -0.0342932434122803, 
-0.0285482205166208, -0.010865863553166, -0.0159540447235691, 
-0.00563151872007106, -0.0275736226150244, 0.0282166696414798, 
-0.0358678859390947, 0.0113106224603791, 0.0167519190600322, 
0.0485654840188928, -0.00988464647749976, 0.00810944992478874, 
0.0156358325592735, -0.0102582814074841, -0.00812666728327845, 
-0.0189704279808814, 0.0214957625647127, 0.00378361662229013, 
-0.0293426550991672, 0.0186062569473873, 0.00682069165493995, 
0.0164627397507833, 0.0495047905838022, 0.00461039633754913, 
-0.0287954913543698, 0.0199824550119793, 0.0163884904312676, 
-0.0402846339299329, -0.0511606355627448, 0.00992006049359822, 
0.00567192208756624, -0.0336291284531413, 0.0256665734832543, 
-0.00092867514164805, 0.00192825477496135, 0.00349382466078657, 
-0.00655765047813947, 0.0295259916160095, -0.0286199759665214, 
0.0179980385645469, 0.0154181180983749, 0.0117734999311349, 0.00922212329505165, 
-0.00482609047663796, 0.0129208249397283, 0.0014554562323303, 
-0.00817423389469141, -0.0112568009816478, 0.0156379462816315, 
-0.00590694517642614, -0.000260564835710859, -0.00563216539673893, 
-0.000705487392767224, -0.00368483054978099, 0.000110138894285455, 
-0.0200357536099596, -0.00396574393142905, -0.020087529991294, 
0.038227546238577, 0.0193364220479645, -0.00674595739929011, 
-0.0139765543962503, -0.010011442225065, 0.00249763432140739, 
-0.0074095154479209, -0.013248456296072, -0.00900591072147633, 
0.0167057898064114, 0.00481664335754349, 0.0369630474855667, 
-0.0209100899232833, 0.0165123479485708, 0.0164244017337092, 
-0.0205549831435941, -0.00710096147277555, -0.0350155278054469, 
-0.00750443410857607, 0.000613213901830677, 0.00953229398785527, 
0.0051500739944007, -0.0139842661369889, -0.0115773461591108, 
0.00715610579915391, 0.0102860967691623, -0.0255838428968743, 
-0.0252610587316655, 0.0125667512479524, 0.0119575372984836, 
-0.00119047288411295, 0.00426435295555755, 0.0205031272968806, 
0.0169575548462063, -0.00727488566916046, 0.00453127438475617, 
0.00245001503902762, -0.0210965250433542, -0.0453182866502162, 
-0.0183538457170219, -0.0367403897089121, 0.0207753733347554, 
0.0233535954212058, 0.0234016441874033, -0.0136518737181099, 
0.0224206603655806, 0.0100701482434145, -0.00385521215333513, 
-0.0117274069467064, -0.0134526710211553, 0.00344553917312029, 
0.0166573007554235, -0.00415977495922996, -0.0101145420762794, 
0.00708797158168713, 0.030664699366115, -0.000502929477738983, 
0.00252306419557632, -0.00513497490890103, -0.0338806107348906, 
0.0169885012299292, -0.0111173254912922, -0.0146578657407174, 
-0.00569455372837018, 0.0292777312822665, 0.030400764276557, 
0.0194023513834864, -0.00560700082309412, 0.0476514449222079, 
-0.016873265613409, -0.0136355046936692, -0.00744162116062856, 
-0.0230388727333305, 0.0243386223045766, -0.0505907868546885, 
0.0170899028883915, 0.0128831908072163, -0.0104790977928028, 
0.0118843674555879, -0.000580866343272127, -0.0322006699995405, 
-0.0571029215953082, 0.0150959721783832, 0.0240437831352716, 
0.0343554286974974, -0.0151649510601841, 0.00707132978269158, 
0.0101529478697015, 0.0104523030796035, -0.0599331588475107, 
-0.0172014977215412, 0.0258028915609187, 0.0307894892700357, 
-0.0381883873784596, 0.0483198469017118, -0.0186170022700433, 
-0.00389477807866867, -0.0462197264189534, 0.00142445988658608, 
0.0473541056974305, 0.0509822209902755, -0.0393206162726611, 
0.00891341272360402, -0.00317890204816284, -0.0121404494655165, 
-0.0146631104980551, -0.00812051566705125, -0.0153067747933429, 
0.0545437452007981, 0.0120578892226739, -0.0203132663136034, 
-0.0271178849446689, 0.0425026714219451, -0.00888547837258577, 
-0.0113596479892556, -0.0163411426886465, 0.0047146568537799, 
-0.00403138019239248, 0.0421383551131268, 0.0196580665505537, 
-0.0280233553275886, 0.00370035781459014, -0.00159051815059237, 
-0.0397235510551746, -0.0102378462659905, -0.0203741035279274, 
0.000265676959394076, 0.0175940647818968, 0.0015837804641032, 
-0.00425779226863558, -0.017877801853049, 0.0473064676140628, 
0.0168557131677451), .Dim = c(19L, 12L), .Dimnames = list(c("1891 ", 
"21351 ", "24298 ", "28618 ", "3413 ", "35574b ", "3727 ", "38733 ", 
"38733_2 ", "43621 ", "46317 ", "47401 ", "5486 ", "6894 ", "J5326 ", 
"J5327 ", "J5328 ", "K54009 ", "VPPU_64"), c("1.X", "1.Y", "2.X", 
"2.Y", "3.X", "3.Y", "4.X", "4.Y", "5.X", "5.Y", "6.X", "6.Y"
)))
´´´

I'm thinking it may be as easy as transposing your data with

t()

Thanks a lot! It has worked for most of my datasets, however, in two I still get the same error. Do you think I would have to apply other different that t () in this case? This would be an example:

structure(c(-7.19849990020692e-05, -0.00365537298934994, 0.00586514382858723, 
0.0154677396613845, -0.0168375092007905, -0.0238730279763329, 
-0.00463700335113514, -0.00140774725761797, -0.0227310376603197, 
0.000944247745469603, -0.0282778511457676, 0.00455052909507597, 
-0.024063336090216, 0.0213992156680146, -0.0123773999332284, 
0.0346301585684641, 0.00164839206900029, 0.0201716603994903, 
0.0118760281835722, 0.00969188792372065, 0.00950580171910493, 
-0.000380105141127927, 0.00090414373629155, -0.00648645280818514, 
-0.0101640811007866, -0.0124038480939609, -0.018201310868042, 
-0.0205720435487332, -0.00478477801308757, -0.00775193133046007, 
0.00895465119752054, 0.00139218314129776, -0.00205461093485173, 
-0.00715591430136366, -0.00398304026776097, -0.00730543865957793, 
-0.00223078482975507, 0.0033346769733461, -0.00569330604037423, 
0.00832214977372237, -0.00889125523472467, 0.0123873025746951, 
-0.00718032541417819, 0.00600083484753995, 0.00716059391693673, 
0.00227745626039449, 0.0095445822654337, -0.00112254489691792, 
-0.000502097068166326, -0.00514068999122233, -0.00966153407251718, 
-0.00751797070354637, -0.0162215924615115, -0.00891189516559245, 
-0.00628027635230978, -0.00913663128893718, 0.0152167419596468, 
-0.00842732584569011, -0.00412155841646565, -0.0143321179654367, 
-0.0101769960657234, 0.0141521461940929, 0.00767674444539147, 
-0.00505807178180799, -0.0149369266129769, 0.00850718911019888, 
-0.017041487638083, 0.012051738891468, -0.0122640388306734, 0.0121798519628162, 
-0.0074792565915752, 0.00391672842324036, -0.00525642444155323, 
-0.00975166515510238, -0.00330754662785734, -0.0153878016671455, 
-0.00396466445900568, -0.00805538772174186, -0.00276807791270343, 
0.00269467066310144, 0.00393665880942329, 0.0144352104017075, 
-0.00262226422481133, 0.0185147482616797, 0.00653238282367176, 
-0.0134752643482966, -0.0183082449056136, -0.00784651893542299, 
0.0213584854775438, 0.00985608878857164, 0.00611726592833481, 
-0.0105073377112242, -0.000442739451405831, 0.000826572775134174, 
-0.00518988327670678, 0.0102661183817502, -0.00987124788428693, 
0.0150081632401859, -0.017000072700007, 0.00397070154043896, 
-0.0212626351730117, -0.0127449105176614, -0.0132856764489837, 
-0.0048961313986076, -0.00430316151657465, 0.00145042027496379, 
0.000433297069375679, 0.00674087323220753, 0.0115747492237336, 
0.0116622596392531, 0.017472115504835, 0.0124635503487693, 0.00126985853182208, 
0.0128517057262822, 0.00660284862405747, 0.00915637586002078, 
-0.00814917821821843, 0.00106285919747613, 0.00210549106290197, 
0.0147145978358576, 0.00383838652937986, -0.00525659142107266, 
0.00386041696495359, -0.0192416230505488, 0.00448533928937359, 
-0.0310339598722083, 0.00886900102301541, -0.0140840651219351, 
0.00758522741115786, 0.00898869848175902, 0.00603248428294893, 
0.00776451296633284, 0.00603530436518006, 0.00051725616619692, 
0.0072197187870922, -0.00681069474415536, 0.0049318795978261, 
-0.00997855455363649, -0.00766286573048831, -0.0022574637171795, 
-0.00180875697147278, 0.00335187610534309, 0.0120393067613553, 
-0.00192542135765457, 0.00337250809625446, -0.00443332054756604, 
-0.00237786823346101, -0.00269386710680918, 0.00135732115149237, 
0.00597273697835174, 0.00145058430865849, 0.0136771870183705, 
-0.00172025478234165, 0.00279289096602605, 0.00160402234400993, 
-0.00528018800100442, 0.0138013862818368, -0.00558446112826009, 
0.00701239279507647, 0.00361732462172667, 0.0022184158148589, 
0.00636990025662643, -0.0134112812174752, 0.00547217562052215, 
-0.0212512099868607, 0.00216177485569594, -0.00640172539047583, 
-0.00281469875573429, -0.00728614005743404, -0.00741531155518993, 
-0.00856205355978363, 0.0146213292445114, 0.0117177630131731, 
-0.021319042190734, -0.0071683831504602, -0.00709938254815315, 
-0.0090147178461485, -0.0106599977572939, -0.005416930711562, 
0.00258721582340354, -3.64240528838598e-05, 0.0246100836176536, 
-0.00224782992832781, 0.0301375187824011, -0.00890575845749871, 
0.0179582444524107, -0.00727402863925851, 0.0103945522473424, 
-0.00661822675628287, 0.00227351945240737, 0.00258218375725007, 
-0.00366010977678208, 0.010607550211522, -0.0109707523493621, 
0.0110116077416748, -0.0191269766311197, -0.0051915733620868, 
0.00250913846654187, -0.0103100065551509, 0.00278797764578727, 
0.00556971584375356, 0.00121797653971888, -0.000342206993348318, 
0.00128730932013877, 0.0131941427937395, -0.00216960073520619, 
0.0137639963719814, -0.00343954273736697, 0.00910278120754761, 
-0.00581750830552229, 0.00103347029163835, -0.00285918187280407, 
-0.0106443882853528, 0.00511932391974475, -0.00735094703018985, 
0.00164537786433753, 0.00542103394967119, 0.00197271839795983, 
0.0181562934877721, 0.0037460292606933, 0.0143357247278434, 0.00408229025721488, 
0.00687045855992, 0.00225250024047932, 0.00668502049428076, -0.00139123411770023, 
-0.00220205303150882, -0.00734670926229565, 0.00140129536537564, 
0.0165280989521085, 0.00605907479609847, -0.00140072681046495, 
0.00194312343093616, 0.00444101823148148, -0.00333116309942527, 
-0.000787145143331452, -0.00757899846598724, -0.00993909925440287, 
-0.00701076850205099, -0.00838161490506903, -0.00300152783973548, 
-0.00404520963556574, -0.000817215535344663, -0.00821522285515807, 
0.00445684590299025, -0.00650984766179492, 0.00293456957381813, 
-0.00323979620278347, -0.00278454470579263, 0.00172056364687661, 
-0.00231818908770763, 0.0112676828422524, 0.000132656497406386, 
-0.00418731572013977, -0.00545010126578739, -0.00230562218876491, 
0.00938792204651444, 0.00176870842833424, 0.000478224945539772, 
-0.00223233917329196, 0.0054943808736437, -0.00206473514114863, 
0.0137619749890316, 0.00461893141245356, 0.0184236063043022, 
0.0014503153542291, 0.0134647821291872, -0.00500922581510386, 
-0.00224561791516949, -0.0039927499049688, -0.00957874657809013, 
0.000245220520784466, -0.00679052021396636, 0.00180251858631295, 
0.00213066004293061, 0.00163052889883536, 0.0184569639548361, 
0.00312412920889078, 0.0144847259473619, 0.00410159165817249, 
0.00764163573623747, 0.0169602148400671, 0.0189537634172511, 
-0.0188017432368731, -0.0221131763018029, 0.0204116469786102, 
0.00707068055556962, 0.0132078619780889, 0.00386610933090019, 
0.00214386034920814, -0.00117949089203029, -0.00930677461118922, 
-0.00318421295798347, -0.02253196421609, 0.00642757690362461, 
-0.00888023006656474, 0.0185081918091722, -0.0211697949063956, 
0.018503535502946, -0.0184496019534775, 0.0014049995581711, -0.00715676875025557, 
-0.0136845671568348, 0.00463847341556305, -0.0234484522825348, 
0.0139049072541166, -0.0189152722690182, 0.0180416740460981, 
-0.00481957936356888, -0.00774892118117472, -0.00651643701700472, 
-0.0104023667302583, 0.00422670322838225, 0.00899978399380932, 
0.000102364335706633, -0.0041305701751058, 0.0157173258994258, 
0.00592905513524116, 0.0188454220436824, 0.00911940623503471, 
0.0160473886228276, 0.0086252600523476, 0.00777400146387149, 
-0.00261457271778587, -0.00585109571949636, -0.014526001259519, 
-0.00511805608597681, -0.00597145321640299, 0.00789520308607927, 
0.00228465498447706, 0.00798143405874145, 0.00595829727194631, 
0.00456238984657505, 0.00669667410442861, 0.00891832904472966, 
0.00649876881346728, 0.00289537913116768, 0.00466422183389043, 
-0.0103219925671457, 0.000880259411273996, -0.00202317436158042, 
0.0104689657438015, 0.00295602112643992, 0.00377320494078467, 
0.00226661107538986, 0.00416136341502328, -0.00021694020185622, 
-0.00487327065663182, -0.00297030093963434, -0.0142155817813465, 
-0.00486994142499924, -0.0136226453081204, -0.0109680471710262, 
-0.000595178837562688, -0.00727714346398169, 0.002110862968075, 
0.0073283254906577, 0.00360599679329136, 0.0163781451552461, 
0.00479483816900253, 0.004518268340483, 0.00468191322191715, 
-0.00242971740592476, 0.00690658782807233, -0.0131105403682987, 
0.0091615108967682, 0.0171051974083715, 0.0165385026173917, -0.00304202337582089, 
-0.0227874573012074, -0.00835571462656699, 0.00705080545952457, 
0.00971592132009643, 0.000715093720285625, 0.0136916436534269, 
-0.00613193229534582, 0.0113775115304522, -0.0175530211175473, 
0.00959345751994508, -0.0222492195280416, 0.0188997532269728, 
0.0103152616991012, 0.0114435378678118, 0.0191264036423704, -0.00255675355972841, 
0.0120429352144055, -0.00997756717446821, -0.000189864471208386, 
-0.0053470771016525, -0.0117110012151785, -0.00135237198026807, 
-0.0203248994596891, -0.000167536298651071, -0.00161796764458079, 
0.00770235001998781, -0.00870497813523731, -0.0122319937027004, 
0.00298203680972074, -0.00232701605965626, 9.38839879582169e-05, 
-0.00821315872412837, 0.004801972898258, -0.00811995865985589, 
0.0103572721035667, -0.0061924829080866, 0.00820671452961168, 
-0.000652907049839474, -0.00207969281427193, 0.00920685284504977, 
-0.00776958318596902, 0.00375527441147872, -0.0072371936215345, 
-0.00362597816041228, -0.00385177302817631, -0.0142485721028932, 
0.00138922664997493, -0.0193694679618401, 0.00501055892926652, 
-0.0133883728497303, 0.00406657773012619, -3.89873001724063e-06, 
0.00403683692001945, -0.0106217931004171, 0.0117378544581962, 
0.0152528090522932, -0.00809338035284275, -0.000888334903230171, 
-0.000994372062375518, -1.24782234605927e-05, -0.00847670328367191, 
0.0037166901372936, -0.0205815954535063, 0.00724337835312821, 
-0.00955389004959006, 0.00201371505568808, 0.00118119887637461, 
-0.00997477206996312, 0.0122349019944942, -0.0103524009277658, 
0.0101383725201467, -0.00426008164451557, 0.00376668847588487, 
0.00711246039149333, -0.00259438078756328, 0.0174135105588564, 
-0.0077210759082102, 0.0190704189121499, -0.00911406384019745, 
0.00468072095901319, 0.00381606397852992, 0.00724075170139258, 
-0.00996126486876919, -0.0107686080247046, 0.00875801071091709, 
0.000230178015512271, 0.00261623843902643, -0.0119475194968655, 
-0.00230317895407078, -0.0112283810370858, 0.00435528892281968, 
-0.00676871292772157, 0.00950825961113562, -0.00125638729536516, 
-0.000502301430100673, 0.00886762626583651, -0.00401031067754249, 
0.0022264789559519, -0.0113483317355238, -0.0129887307140663, 
-0.00531044776764224, -0.011125300198108, 0.00057123741144832, 
-0.011240518774711, 0.00520324815159482, -0.0147641375578644, 
0.00931719430436282, -0.00780960796962697, -0.00168092403485997, 
-0.0080497725396459, 0.00904452064084908, 0.0151100680629028, 
-0.00854417966711439, -0.00271647762587587, 8.59513250495539e-05, 
0.0121360404400567, -0.0108469800395341, 0.0166046642337192, 
-0.0155439537097448, 0.0168612597669083, -0.00552303298000804, 
0.00929486210859128, 0.00572579654234267, -0.00756775675315583, 
0.00712431800115246, -0.00603255292777121, 0.00789376606993117, 
0.00134428420600502, 0.000318411459435122, 0.00904399377498885, 
-0.00713708109907083, 0.0194892491045908, -0.0109864023850218, 
0.0165088480059693, -0.0100840988318894), .Dim = c(28L, 18L), .Dimnames = list(
    c("1.X", "1.Y", "2.X", "2.Y", "3.X", "3.Y", "4.X", "4.Y", 
    "5.X", "5.Y", "6.X", "6.Y", "7.X", "7.Y", "8.X", "8.Y", "9.X", 
    "9.Y", "10.X", "10.Y", "11.X", "11.Y", "12.X", "12.Y", "13.X", 
    "13.Y", "14.X", "14.Y"), c("1889M ", "35772F ", "40646M ", 
    "46317M ", "6846M ", "6869F ", "6912M ", "6913M ", "a6868F ", 
    "J5335M ", "k54011F ", "r1524F ", "r1771M ", "r1890M ", "r3413F ", 
    "r4317M ", "sin_idM ", "28433M")))
´´´