Hi, I am using wilcox.test function to test the difference between the means of two samples. The data points are paired, so I am using a paired test. There is one strange case. Sample A has a higher mean than a sample B. However, wilcox.test function says that sample B has a significantly higher "mean rank" than sample A. How is it possible? Here is the code (data file is attached): df <- read.table("wilcox_data.txt", head=TRUE) mean(df$A) [1] 0.7987849 mean(df$B) [1] 0.7977966 mean(df$C) [1] 0.6350737 wilcox.test(df$B, df$A, paired=TRUE, alternative="greater") Wilcoxon signed rank test with continuity correction data: df$B and df$A V = 134300, p-value = 3.299e-05 alternative hypothesis: true location shift is greater than 0 wilcox.test(df$C, df$A, paired=TRUE, alternative="greater") Wilcoxon signed rank test with continuity correction data: df$C and df$A V = 41423, p-value = 1 alternative hypothesis: true location shift is greater than 0 The p-value of the first test is rather low (3.299e-05), which indicates that the alternative hypothesis is true - sample B has a higher "mean rank" than sample A. Just to make sure I am not doing a dumb mistake, I added a third variable C to this example, which is much smaller than A or B. As expected, the second test has p-value = 1, which means that "mean rank" of C is lower than A (null hypothesis is true). I am afraid, I am not very strong in statistics, but I would very much appreciate if someone could explain me in simple words: 1) Wikipedia says that Wilcoxon signed-rank test is used to test whether population "mean ranks" differ. What is exactly the definition of "mean rank"? https://en.wikipedia.org/wiki/Wilcoxon_signed-rank_test 2) How can the mean of a variable A be bigger than the mean of variable B, but the "mean rank" of variable B is significantly bigger than "mean rank" of variable A. There is a small chance that this is because of a bug in wilcox.test function, but it is probably more likely that this paradox is because of some statistics phenomena that I don't understand. Best regards, Karolis Uziela P. S. I have another strange example, where the difference between A and B is much smaller than the difference between A and C, but the significance of the "mean rank" difference between A and B is much larger then the significance of mean rank difference between A and C. For simplicity reasons, I didn't add that example here, but I guess that the answer to the above question will be related to this one. -------------- next part -------------- A B C 0.493579934773664 0.511836168474316 0.520749710683309 0.630184025170146 0.58786433109054 0.458946430077942 0.633512186023312 0.493175938647652 0.66308680696517 0.491989020132133 0.520090183585035 0.420844896432205 0.0399860725369978 -0.0301629556552143 -0.161169807765403 0.598248869116991 0.637706466762332 0.722797128117201 0.954025476347433 0.977016137944116 0.750624074377985 0.862950985422539 0.868732350639475 0.730996449953475 0.659015458019471 0.631657908519014 0.649268814371901 0.944446851459376 0.951663741829449 0.887377555251177 0.791126281396265 0.806829715682826 0.520987050223108 0.790981668919217 0.832554187306653 0.816906470482764 0.952134063327928 0.950267697811188 0.888111039865367 0.979447757413485 0.965082926636581 0.978260925492216 0.767165875729762 0.809954221337577 0.598870382402464 0.913408312148682 0.952665220683963 0.943094656757241 0.972608015661106 0.979393087897226 0.93167912128025 0.92368233901018 0.884309958031427 0.857603379672018 0.898019141975969 0.902422790997998 0.972835691590958 0.583425531942068 0.60080296136487 0.0762982452965866 0.971925274787888 0.97627957685407 0.937911525197627 0.809897828917177 0.800664937235237 0.799131043225983 0.85205447905511 0.913651623435268 0.947490858434091 0.673979778229831 0.757789915726126 0.785004269972942 0.92791391929192 0.952431131239962 0.958965163180968 0.888104211563345 0.896293265932192 0.757021764767304 0.754923516313538 0.743209910646708 0.400590699921333 0.790444023531614 0.839202269416027 0.728543527605082 0.489700648107734 0.546352461567751 0.246692598690384 0.919047447196611 0.937637379169673 0.854373325181927 0.746567053460642 0.732674872823925 0.696672515669091 0.82109253132961 0.805084424922876 0.795858547687794 0.931033788637529 0.94668898248564 0.852845771346312 0.789707695658712 0.804674058488827 0.917422903218963 0.948317951802274 0.974637687624406 0.98965193862357 0.710108950455433 0.863972180005134 0.693696835692262 0.812826034207032 0.848422587445403 0.577844837616433 0.833755877836278 0.762137912181951 0.744863154045316 0.754586240931889 0.818206106263108 0.785493914964923 0.881927578630931 0.852124198530008 0.862181321497686 0.815417604208001 0.82311408988169 0.59316052481171 0.913033642409478 0.909933623735767 0.740059472208528 0.928085804060841 0.9223273915188 0.316043076521959 0.543637616376008 0.589592007011875 0.485877283274438 0.874049458665115 0.909943060701501 0.913855131935667 0.959075608346417 0.957696030631906 0.843851296934062 0.978772523729638 0.958814112945292 0.812774949140785 0.884601693363262 0.893145861301054 0.843576269983102 0.735309787061252 0.81137400195044 0.766380226012671 0.46779299991889 0.733361031281304 0.421834898498109 0.72378630091144 0.79085876438516 0.783594790580892 0.951718514303004 0.971767512029797 0.938568230863075 0.820647677550502 0.890003391686164 0.916770037403864 0.894649111289015 0.929900438372412 0.949518546837625 0.984954087537257 0.97930378134097 0.979348053302179 0.970633924732271 0.985211722082783 0.962100611851053 0.710516337134258 0.739126551974364 0.699607102878997 0.984405712185357 0.977307751017649 0.954861663931582 0.983920526322112 0.984537921917469 0.971592254814624 0.466239070227376 0.361741743886008 -0.174738780387518 0.94282850951608 0.933812776886823 0.625227225585054 0.94914415945383 0.962583528896137 0.744176003991798 0.915094678227646 0.928456517058697 0.476421111762582 0.993587166273857 0.996285204465067 0.985857362071796 0.908042859812164 0.847101520076557 0.598232887046877 0.840452323542133 0.798011590517737 -0.694743213964122 0.422099169148996 0.609419532799908 0.448615199397706 0.918031994351773 0.901694473118479 0.812343868448751 0.845326698088311 0.869379283718194 0.885066856802163 0.616756556473096 0.686832743709021 0.639315370856217 0.887939533245616 0.902287657584748 0.890507677792163 0.788881247551529 0.741373116124734 -0.371053039690801 0.389137304415585 0.259630347033723 -0.0724512261926444 0.904922616089958 0.94935781724179 0.951135682548357 0.742299549301948 0.746412575104721 0.829185404371343 0.916948654143832 0.89354844522675 0.64150937687876 0.872701018718808 0.876167264806694 0.761036925518975 0.930112226511015 0.926157100267425 0.297189274650013 0.470087575286738 0.380534850006932 0.40602484355202 0.970854913671482 0.968010680402036 0.847536803796624 0.916192780269171 0.926252785150226 0.625659506159647 0.862722855902278 0.899425870014402 0.832197063410964 0.927088800706919 0.941599982815054 0.903226259597218 0.966753518064433 0.97421378977126 0.972763857120473 0.89224689322241 0.934376566260259 0.818881739613863 0.919107867228064 0.885754256669265 0.308503554052381 0.927955317301452 0.928614469953911 0.884063624298141 0.93503641339244 0.946200263377236 0.815915302861623 0.509080915965794 0.614951542996025 0.874720860537972 0.649562229896905 0.655889354905295 0.651190470763373 0.426404120422999 0.425511692039041 0.225378475923062 0.975755192724236 0.967733949986192 0.812800536471055 0.810122939148917 0.817035725303701 0.442163090129947 0.926967166553202 0.833659852906183 0.344260053168499 0.345246278550481 0.359715124091237 0.414606594175528 0.896862764009394 0.907859225890107 0.821729417101552 0.203839114997977 -0.0263969121324794 0.467792111087893 0.442467288985765 0.32918242907837 -0.288772885568062 0.740123604355756 0.548592817939366 0.426459202083828 0.926973597059932 0.867592790504451 0.83015472274446 0.771748927890767 0.731653604321067 0.764133062962764 0.565728734284043 0.348615450264296 0.560782544642047 0.378093361164821 0.177929288335763 -0.45947609815358 0.780632157020623 0.790573326424775 0.664405792390361 0.706193658274475 0.753867177437173 0.823757796309575 0.907703422650535 0.903041337336032 0.557459654905084 0.938323630013061 0.951376388292422 0.929894504953061 0.988816398140094 0.995182745657621 0.968649949548063 0.939692780915426 0.945612416410697 0.872030064297716 0.85967116996969 0.874606181583675 0.907070004787014 0.657519148630391 0.663052472860378 0.701584898958156 0.868644493301894 0.906858779983468 0.82853932998898 0.968939905556126 0.939058513591689 0.860994921905067 0.441037627735958 0.0852412514795427 -0.384203580608687 0.670549544960338 0.604254725766629 0.146036692476374 0.840415531063806 0.877046743511529 0.672084631736515 0.888407003754489 0.903589877676542 0.988782360292721 0.763713145802758 0.669606481336483 0.408360413454635 0.95562047117574 0.967654189421063 0.979369262965857 0.954608747986583 0.966997001260396 0.932477870266137 0.763162439983482 0.685993156192 0.106763115899465 0.778970803689684 0.744642661856399 0.536228194394303 0.126537767237038 0.1097379113854 0.436617735267081 0.834621578003821 0.81832207828217 0.705245066092655 0.993840689509455 0.994969860404798 0.960312386430966 0.997576688418417 0.996274428952783 0.983482941996238 0.59653199123089 0.665244538709554 0.372158322723303 0.866622685504223 0.837782890055459 0.822094248258434 0.925082171768026 0.913436842922549 0.747766442631738 0.807233214856952 0.825027803454486 0.767588334176771 0.887254336862892 0.895179592418163 0.579565247412942 0.944740855055491 0.973736016160411 0.967715135555038 0.749862528692852 0.735463466076788 0.685884412652767 0.704942326400261 0.641808490069743 0.234128305470883 0.893734474235277 0.899269851658693 0.842227892341208 0.849003576534742 0.812097469893554 0.63206702828911 0.425229521004169 0.529280246679043 0.223793373535761 0.602879259162558 0.485167542518944 0.524708736575311 0.863111565014094 0.854567802190186 0.451217637870889 0.801452275986311 0.8298343582069 0.840606822524787 0.775099066693442 0.796205567975574 0.835698369243805 0.972367874509853 0.986398564747153 0.914073530201955 0.756821224373484 0.82696585938921 0.126605637491318 0.861604172308255 0.878747909569353 0.821381214830267 0.896558442779516 0.906114650332194 0.922495331438113 0.973656103581577 0.980020028988727 0.977482424123513 0.46943631042178 0.203280300005456 -0.57501697939457 0.820195728643943 0.787621048667168 0.288980321383919 0.935838775373554 0.974312245324092 0.902862148424352 -0.122880036379635 -0.00583649476909729 -0.973245236604004 0.81835342040879 0.855975213150872 0.912672889462877 0.917093787308048 0.954877764812395 0.834335957938079 0.67619293348308 0.666004443220055 0.708322200481482 0.866226118204842 0.914908928689388 0.917031180938168 0.89024773676408 0.885787628295869 0.540733959323575 0.754819894953781 0.769434224603023 0.647742907138654 0.684642696182166 0.775669427916627 0.765019268468051 0.983677056670557 0.975974450245943 0.900320014804052 0.953138242664692 0.945841197639148 0.742458074934671 0.858194952378934 0.887310648331349 0.469264885966726 0.7564410897427 0.683140204129497 0.670754616909094 0.917328551210749 0.935894765204094 0.974130085077125 0.832653458380452 0.872708122714292 0.902381255017477 0.871254524031489 0.833598538431217 0.606680371926093 0.940477440554855 0.96927856299472 0.9534461717202 0.956418097958012 0.971791172067485 0.983888415893092 0.719053853578137 0.710538704187937 0.790575174892747 0.983860548964603 0.994079476007793 0.990622829172537 0.761228794290717 0.813093369729247 -0.276565238516359 0.828373580913301 0.868775002775163 0.451442011592519 0.817432619720011 0.776684362222751 0.670493364351909 0.776361261636376 0.772175069796674 0.68614392874373 0.630971790476322 0.628834204032854 0.761674631603219 0.812589002419854 0.831855835301694 0.923918260681652 0.798339000147049 0.861450663000911 0.568419831530471 0.825820056829313 0.855276846305481 0.7848435681196 0.933737328395448 0.947961367094056 0.527620933165221 0.517801245642476 0.427759912401885 -0.191764966224302 0.936888016130927 0.95197483449089 0.957446430858066 0.966508485775686 0.968807140637246 0.955345071408243 0.554943478469331 0.504988497442525 0.597226257004269 0.748211783684749 0.570236847116708 0.211500316950226 0.635008030605781 0.414201657440733 -0.160574903046965 0.910629028675876 0.964605951051625 0.557605421760767 0.821499536305995 0.81428432498582 0.760621880401758 0.880673595984699 0.896643583804582 0.83463109607411 0.948454799836736 0.971449536767249 0.94521319106619 0.827240450052554 0.839468893771056 0.791303555049296 0.659142639649277 0.699417977696032 0.594007179250164 0.572534305709967 0.530503265453703 0.348341711908482 0.928337168225409 0.908028192461222 0.790366827060429 0.86823371837414 0.835095415781723 0.703726887100157 0.864268764698617 0.891128340904382 0.896378072871169 0.897882058153567 0.902811816665023 0.763190631771032 0.896031295915387 0.930069379395208 0.981394849914461 0.895496330541064 0.854945877838312 0.511889332018459 0.801287617808147 0.833617828428096 0.656358772971686 0.739077717056035 0.769057793060361 0.822752706217634 0.912290825601606 0.868620742081562 0.532755034023027 0.74716177620225 0.783138569641578 0.533364209988158 0.872579385831315 0.878037772365449 0.726876209675951 0.944336866611992 0.973149063270625 0.979055920404787 0.942485526936128 0.950493970337293 0.855651972134109 0.883068051675146 0.829316392543948 0.249768843979566 0.865501958666126 0.886840200570514 0.783582887226957 0.811188869697184 0.827169483469215 0.85459596764949 0.785507356744668 0.806345950360196 0.816667646924888 0.632683821642497 0.684207535105998 0.694959943694843 0.729447978999586 0.742420377850658 0.707067795582252 0.411092873829916 0.0944628460275495 -0.294672885025785 0.726072958022874 0.74244731626591 0.0687722795540926 -0.330890302068655 -0.0457372792146919 0.108202876206052 0.932448300305783 0.967397309894982 0.799813046100294 0.938615958948809 0.950228162608815 0.984729237466921 0.862312863270213 0.876030131246224 0.773322694209985 0.802909911919016 0.814664662790306 0.673644304952727 0.537245775535581 0.59568680616353 0.357450577576039 0.923046013267404 0.963503082187343 0.957156257073327 0.750396384976156 0.787663714664349 -0.424002556891962 0.59470549427114 0.667664872394462 0.78018374213655 0.776478033508543 0.733086797791586 0.519113683659099 0.473386759720366 0.426124919605943 0.137487591022331 0.93085276840244 0.965686216437316 0.944806188081141 0.949651960236204 0.954577170051486 0.953008219844542 0.921874814585065 0.916405085166328 0.773771558240729 0.952831265998364 0.931214666629058 0.712702608001579 0.63989261133683 0.630946468626859 0.0538933177848744 0.785935782382091 0.81969861212605 0.674475596055971 0.695740046343717 0.745735986255438 0.584811414902907 0.799565362670004 0.758575332553155 -0.159858727961625 0.975861334618976 0.983183722045209 0.990073554057967 0.775443468432351 0.879110991047303 0.957786694034003 0.820854166080632 0.90476719397891 0.929976932135422 0.94034067931286 0.943107807762238 0.954409062790118 0.79791907319814 0.768940414886912 0.116285046051749 0.901014667406231 0.915923628847393 0.95785077566774 0.698766519848966 0.706199144661695 0.610056942931108 0.958313599606213 0.954017185610482 0.930713112137988 0.780627976101044 0.818303901615231 0.916980065658993 0.943367787695481 0.961015552612171 0.841352202770564 0.937832280996521 0.934860259357998 0.764561249084569 0.9306261382554 0.942557977231295 0.466553169502324 0.923450296759789 0.931038867189232 0.820775361942876 0.948447707570041 0.978736305508656 0.982038646380544 0.843144200702179 0.799557317937606 0.646593902988591 0.787145875429724 0.79192417798893 0.846712217081023 0.494037109819455 0.408477846998709 0.577129316801294 0.992891481734141 0.995403500784464 0.989817023912265 0.735838178896543 0.707266876094589 0.922687904701509 0.91413311005379 0.887554267700722 0.692485371857885 -0.203068197806857 -0.252860279586044 -0.903174131401843 0.583145200673404 0.605182950695809 0.598007772756843 0.915219389815875 0.922808678026332 0.929004124338859 0.801873813832321 0.705152117888737 0.43578031007488 0.718612913831256 0.758976843617767 0.789260593366078 0.829694347169225 0.724499725939211 0.733291349356717 0.961852605578158 0.987151823170127 0.839604623890245 0.833716264658226 0.832651326166087 0.624027679390865 0.907933108167592 0.8968735995852 0.661421334570823 0.565961133621015 0.525670416161656 -0.092534208161062 0.848184519769906 0.8712404507226 0.928714843649521 0.895004420615321 0.932982547590134 0.728966994943711 0.903130717095408 0.927671687899346 0.928521979342606 0.912543085439452 0.929498591742808 0.899787248929208 0.975617779224241 0.956840327225292 0.798685189372088 0.790214468019293 0.755441390380693 0.704962407838248 0.984380598980392 0.984098427878665 0.96960379945779 0.590236129642278 0.299226215374043 0.16175614226848 0.781678384508784 0.85443061276462 0.90077105871717 0.829002247728257 0.809529911179108 0.705512264224803 0.9298212043743 0.958585340597413 0.745751984050036 0.971086776739728 0.956828616910666 0.475400527657182 0.982593228910189 0.982686892320902 0.916589619180006 0.827310193511106 0.901546296470626 0.945156018721747 0.888637689437295 0.877043060607469 0.833304752518105 0.866486769889442 0.894995235245382 0.859833957402684 0.917366696150491 0.940444435681149 0.927369661219215 0.752731946457319 0.601023728260177 0.388458532627953 0.773931086815099 0.853096391234992 0.935378518279262 0.883135706208102 0.920296451619944 0.924840070024867 0.928524881863752 0.906491622022596 0.879225616739947 0.955629366710847 0.983805330613392 0.982241196531248 0.985516434025097 0.981141506946777 0.966681204378472 0.752752535148703 0.762600069940015 0.122533725955314 0.982046088009084 0.980579728839334 0.783038222854533 0.94208791121128 0.957536211697248 0.705419875563951 0.860376151011986 0.814079632413333 0.390526058225893 0.944984791225854 0.948008439613042 0.959099103362359 0.0847542338060787 -0.0717763635211146 -0.241540480842223 0.911034773692286 0.906833944409103 0.929148675677232 0.877246362014013 0.89037346638497 0.657752489546705 0.919996300986367 0.92510756735198 0.789515902926668 0.831435145358497 0.873157869929422 0.854373540201837 0.679095931456673 0.612608295538707 0.52574678353355 0.764297398553352 0.691285982530547 0.510910294540343 0.974005218336431 0.97329346354065 0.974361771194834 0.743123848626757 0.743419249812254 0.29884824324691 0.974106569698961 0.988746628401213 0.961099026816231 0.950938464499532 0.967553067162478 0.960860594842651 0.820744395976536 0.861145469077466 0.839347422493223 0.863655529311045 0.903002496676144 0.793548869516273 0.85702498662078 0.857205693962109 0.692422868160475 0.914281489970366 0.948960201769476 0.881538031556599 0.578413173771914 0.632098201212941 0.607364202275345 0.918699439751344 0.9230102064568 0.677961145344422 0.789755641438542 0.777442418787798 0.709172525341809 0.833571633894426 0.862068683420004 0.800384373741073 0.941588997780217 0.970850984756467 0.845410511140668 0.93576604382445 0.960305829759282 0.839429191597946 0.927666794071132 0.935770608988311 0.89615402036563 0.965340545119296 0.969182223828997 0.884600959235514 0.967236141935704 0.964627056946671 0.938434467041955 0.985828258856228 0.991730720239094 0.965727694272629 0.900841591720698 0.815069334875669 0.742516643123795 -0.0546129215687744 -0.196919821402142 -0.125835960502961 0.713052158123353 0.611241631745689 -0.118711184148307 0.945479651017786 0.952296102381882 0.973090760079203 0.861527554929749 0.868140049218704 0.90867021875534 0.898382876608467 0.911399794287696 0.85693835554059 0.871328066970438 0.925302219779736 0.870654591466658 0.985116371558036 0.982581664446114 0.894362721449943 0.947269681462923 0.982118538548094 0.959525754903408 0.945041945744673 0.966259759958245 0.95745469163322 0.93264554627844 0.960391886485712 0.781175332575143 0.306236108816116 0.252464031730648 -0.115159514556521 0.904399702885327 0.942334395259758 0.924462003258617 0.974144398304822 0.965162226919738 0.853343543970325 0.853285553926856 0.88525792366873 0.783481959968319 0.62756420579315 0.721990240630066 0.172596533873055 0.791875243597756 0.777153296151865 0.832515250338635 0.772324564962812 0.280314845131851 0.199290659837485 0.966817041774438 0.970241143472123 0.936489128894739 0.928912426791312 0.956889742045019 0.933241950282098 0.851227905724664 0.706342934100428 -0.0847474692203258 0.965057417408159 0.950815551505218 0.88902017531229 0.964238038047419 0.981864071435104 0.987105126543163 0.890984143577567 0.926908790226334 0.918407570079617 0.404081927772115 0.394256508229274 -0.206138460623537 0.823571174226441 0.837766533995902 0.637302836821807 0.941787112994923 0.936802712476352 0.728467400621763 0.785901153891181 0.777361446980022 0.138484681796778 0.898081785042625 0.95118396985166 0.911294790822807 0.897540979932421 0.882840700476066 0.75147640069492 0.924589540781758 0.933984621193461 0.86129380479322 0.852087642741485 0.865153968942997 0.896044603923951 0.948821838896371 0.955369156489621 0.926145736675799 0.986070089038004 0.973602929058011 0.981704932375678 0.984515752167269 0.980682608485328 0.970291027082537 0.624230858256876 0.612727424349824 0.820969665022528 0.91917205085556 0.947367719181389 0.434994808736547 0.71824022264255 0.752274988281597 0.53074508222868 0.850761370063642 0.868763965379209 0.922064842794498 0.755933001286245 0.776756302401128 0.536702327132652 0.914404425574104 0.96323145522747 0.830589116979621 0.868498826625878 0.885875281430361 0.330164368726592 0.864657070611209 0.892285346980671 0.940426798300292 0.858075625230933 0.886404003316305 0.868086445180352 0.920178071153036 0.886701773045967 0.831310594779154 0.830892973917849 0.828404922407663 0.125256211775915 0.954657927646988 0.962480692288908 0.898385021096725 0.760776416396796 0.727389160681003 0.15011769186097 0.869742132449821 0.856341294260032 0.577484939424876 0.777449110631396 0.726084563413206 0.520406200648956 0.911432151403465 0.962915744867195 0.949113935595303 0.892590032310144 0.925879121880774 0.870125621130914 0.317074387756707 0.371228755371461 0.281909209985757 0.902399981220806 0.918230276583105 0.217648185689864 0.973339965823592 0.968936901873375 0.928888780909035 0.629195648293687 0.606056980212719 0.055873172723459 0.809602357012081 0.804231479690167 0.544465065094212 0.965599627825736 0.985646654446612 0.899676230597054 0.919340186277069 0.930522923132596 0.906759499022707 0.909854808171152 0.916152824533224 0.662656076837165 0.881662174485063 0.879652788023665 0.676424449861078 0.629550308504981 0.682777752343378 0.82678872095267 0.441746653509004 0.466851974775399 0.386283541218522 0.73034606191532 0.641200220711002 0.155876049565053 0.761621577371007 0.828287216119243 0.860045213731046 0.878592707371612 0.894597199061508 0.846199206259763 0.901442672438961 0.855657239511007 -0.374030222180516 0.944985902167585 0.945979103548583 0.676429124025962 0.780477850886451 0.783207455147782 0.750969492224457 0.975668376413997 0.974516196372636 0.905975647224063 0.932836121279277 0.92538350953595 0.431271730623075 0.377027221412587 0.471254706440117 0.469759449162412 0.933710019477674 0.951045436573515 0.937979623040055 0.790030126518308 0.766690325071663 0.718702606280002 0.735591512390271 0.762238008134184 0.787533912224629 0.861820865367464 0.90318209959478 0.695436861307475 0.86515683460245 0.884564283697859 0.646707290138454 0.885043911490193 0.887690656622151 0.862428296651179 0.983255950851047 0.975597820203017 0.945534899694067 0.920265415852826 0.958260633279928 0.931109936529325 0.817852163522512 0.832492740240892 0.861355174356585 0.884990149830578 0.924931793868811 0.765507234174702 0.901048513508138 0.817865256292967 0.267067633063169 0.893897021281316 0.898379857532923 0.857330573285001 0.676685045863657 0.659177364303288 0.785938345642981 0.989013941121083 0.989719477339998 0.744451820396851 0.79620433462166 0.806558740665323 0.506076681897467 0.770996004932102 0.633081380213137 0.0731991990645124 0.97480204705185 0.979378943558685 0.966744050566188 0.943092729295448 0.957118108496183 0.930734262230313 0.389105886735563 0.479382840051914 0.601623867656882 0.947587241055505 0.977293560784809 0.847215021982282 0.880365664094381 0.928374762746423 0.920806434321195 0.91729151908163 0.911026041541233 0.746802838436696 0.791305617775378 0.822608552255786 0.847843118874789 0.392599233540402 0.483324237033219 0.527462569540598 0.904084094746479 0.916469517497856 0.921381238829714 0.967969689265184 0.969806750686967 0.9268243175193 0.936810757825797 0.958023609484802 0.957073491137597 0.947498891519534 0.90031945505677 0.212923640423066 0.871424495675877 0.899194421826663 0.865484214918939 0.208807984389249 0.292803190131902 0.22084171926396 0.956181635152999 0.974943608354039 0.969706862347359 0.912873921967958 0.925392473890334 0.75257300786287 0.769136603791978 0.707256380297598 0.641742703607224 0.346135011489622 0.0862035952096451 -0.559063186756774 0.597545598435645 0.577339780083859 0.436373559237361 0.814792865827746 0.825753039880223 0.0921330759847038 0.372478845979997 0.45295313979341 0.517341492718334 0.324977333542123 0.30314292848133 0.285609147142007 0.941178275101359 0.957135878537304 0.84381497618171 0.771693716580184 0.842664783693451 0.830130962444741 0.726813004417388 0.809116011919408 0.835069209546399 0.8515910224185 0.872492338223403 0.863240999947693 0.497167677149623 0.54868513830626 0.488237568971136 0.858167276313644 0.898131747974883 0.420351097617253 0.95724451180068 0.979681806671487 0.866143164853256 0.704282762428882 0.75573589707824 0.883615020227512 0.637115072556125 0.629198313573636 0.316742091446957 0.763951170503316 0.79613239535002 0.428433938208043 0.909155206238446 0.929086706068425 0.795634421762137 0.811879202104406 0.831780286751675 0.831975430879076 0.950746822943997 0.942541278624786 0.835441660679515 0.856136125439852 0.907026701172414 0.821715082249845 0.895751431298052 0.774397678205311 0.685423395170153 0.820622031875848 0.862532905026154 0.8452921465656 0.20953815998893 0.164499099319212 0.067136591051383 0.470404167905864 0.567086998981924 0.674374229331777 0.865558118796692 0.885431807663032 0.916779225697546 0.895272692359155 0.884941570180635 0.827800041872242 0.956194399482887 0.935292542915852 0.89492548623297 0.877013245968932 0.850211788348112 0.710496260114338 0.741273239583285 0.610993292125173 0.0967372775693903 0.918668471842275 0.888413617951015 0.669930628278175 0.273496815999839 0.368928252644886 -0.182606698360494 0.831964679018324 0.803134251158376 0.58952523596776 0.724797729231704 0.734786040548832 0.685621652421526 0.8481606819544 0.847171557750059 0.655490304195018 0.856413482186219 0.830468242799438 0.300490452103989 0.650356446080287 0.649118304460756 0.372633637613511 0.892696486524713 0.884637317759991 0.814472991985679 0.909934486026722 0.886596842649027 0.804525451813159 0.794315207255757 0.826222700943331 0.477577245311052 0.821235054267442 0.826227395097177 0.407989007997663 0.738989528519658 0.780496091966141 0.631852252606788 0.445186368945775 0.491156026018781 0.403273601344365 0.927475341574476 0.90148918707662 0.81512758238806 0.668428076316598 0.599464617256474 0.49299698603333 0.856581107658372 0.849876184349411 0.669337801644572 0.969935854637514 0.986744821245893 0.917258912532733 0.831993978448921 0.819994411547358 0.499931365489422 0.776229533704067 0.770536114508147 0.666549785727736 0.931289950704373 0.932714985420078 0.851033616135193 0.486592581886296 0.527335577363011 0.00338129424529159 0.475573820926443 0.495313334114259 -0.222731881698814 0.967096352442631 0.962412841411444 0.837793394919888 0.693726250473672 0.606576240991988 0.0170346207082271 0.655940540020771 0.683834829634589 0.43310834370858 0.923913291085322 0.948028306248524 0.940120582039941 0.461818473686118 0.570789367214268 0.619046263819566 0.77514217818394 0.806036116218095 0.766153273243611 0.906247891805768 0.909427922092172 0.815888780026844 0.911933074420433 0.85843693564312 0.640746749795542 0.974715547003288 0.986325025506383 0.989014848134041 0.813869322468504 0.837089896913542 0.797791394883928 0.794315800314097 0.833248437938487 0.416593637807143 0.599970902454595 0.626595826007598 0.529461870250176 0.928717538001019 0.845435316823268 0.429634783159329 -0.366297665255341 -0.664087484772644 -0.663010165240259 0.892145464496312 0.942444725502778 0.981620170374315 0.922032688370689 0.935939191501001 0.889279316895892 0.538587874808634 0.408796885276432 -0.0164728374629681 0.881474659478422 0.850697171636774 0.487267219746627 0.878826508576141 0.803564303429199 -0.40407333462595 0.673649979628943 0.658228356573187 0.726347169185064 0.867317514668069 0.921646665051011 0.94760603884248 0.967606859324396 0.98575602373781 0.931261119084622 0.788484866065957 0.865655003430722 0.734178281688343 0.801000645457594 0.743401752766687 0.206838541490131 0.94190389922297 0.971460094700521 0.974598499410711 0.886930607746625 0.896839118194855 -0.161721429542072 0.88545553897907 0.891382466156172 0.592806879437997 0.830000882810832 0.819691726664367 0.419866495033366 0.906511229493449 0.862104146642431 0.459099710852697 0.881198208152545 0.874497273462913 0.100052825647589 0.948045826669421 0.959100225585331 0.68672857115415 0.889394518351832 0.883789530898064 0.725495199467053 0.979896868594031 0.99103503740922 0.954062735638532 0.176883456891012 0.117290441234913 -0.387776332051181 0.985180045477305 0.98715185272223 0.943427306428467 0.777583199477414 0.856983529497389 0.872684121509007 0.643878000082737 0.685925805219436 0.502868566247907 0.904778757142647 0.897340720648509 0.785562454851993 0.902540671240791 0.917119450834789 0.778939066744741 0.976385634548125 0.972110952275929 0.966835784285672 0.911573411627314 0.936524149583518 0.883728582994923 0.917097067304138 0.935652223141437 0.728913524050728 0.0356410633794753 0.111901057922623 0.47628995507924 0.697796694898563 0.725283616635345 0.130875016733272 0.839706203930733 0.86324544205325 0.223362816445724 0.925505061123559 0.919935027173955 0.823483604614016 0.850548557739402 0.881783916643879 0.837150531516227 0.958548411116715 0.968988002992216 0.590082818973437 0.978911397296622 0.966112657558133 0.74791029211882 0.704349775306776 0.744897733658761 0.605025264523317 0.981993257901754 0.986971333073666 0.928841212333589 0.544976975122236 0.527175757671772 0.629650731421551 0.855958468585241 0.880670031226991 0.965720280244462 0.907581181627017 0.925092727639086 0.881900738563556 0.731304426982639 0.740411655143885 0.819909338003745 0.878483153405748 0.907843033204954 0.795792626895298 0.438222920342998 0.477301257512746 0.516279463739531 0.716064184568883 0.611049123044408 -0.171980095955396 0.881005818857674 0.863626532183171 0.728687809578206 0.752755771394889 0.815256889497842 0.853094034170529 0.902414515380923 0.890071120030953 0.249148716328332 0.832179174773198 0.831021602290392 0.621932242577592 0.916823744512368 0.871191802484265 0.371632334680811 0.99770440952849 0.99888551290075 0.985783918394081 0.952220125239789 0.937090572957188 0.822913092899728 0.904043795610166 0.95015382150857 0.968502037310913 0.817112644565319 0.865235900684586 0.836781777640196 0.714232983534997 0.802823815270301 0.680790284440525 0.758617976680244 0.836648302492214 0.886321515001151 0.690567530385235 0.70899936060918 0.742941456038704 0.99506675663051 0.996742934215349 0.965262096718403 0.99613673523277 0.994191992742282 0.990020158400958 0.940927562390441 0.975207708170735 0.970263645160772 0.854527532855826 0.868357245877745 0.860405718623282 0.559390417700558 0.529991249176327 0.508431340740209 0.894374753887393 0.959281228775858 0.988563304439434 0.119838082872218 0.245027985997707 0.457443636255934 0.754073589297909 0.855156741684349 0.531313168711054 0.769476653858381 0.799487584972754 0.661707683926858 -0.184132740235799 -0.135326085531291 0.0560259154942396 0.953485748213357 0.943946156768227 0.729900730065809 0.961474807537094 0.95327948324189 0.444191994666425 0.804832399081625 0.774316070903369 -0.164154367996673 0.816256952018486 0.748474304167955 0.257369189838948 0.889679274404683 0.889038668927968 0.878574704556336 0.772919789350575 0.748677485663895 0.550772114674343 0.984225566952617 0.982913393962045 0.983239392690558 0.909584081939801 0.896153091878514 0.766722017755904 0.910094001276975 0.887829864220171 0.825690913910728 0.86339043366717 0.928415085764748 0.832653731345379 0.896000188026363 0.895259333994353 0.338797460491261 0.875181922189682 0.88881644348533 0.837546731096798 0.95793685692336 0.948342900306188 0.919142461276978 0.981130304003055 0.978915138855779 0.946382266647611 0.754632859570489 0.736917248425645 0.307788843491006 0.828079627748669 0.688300762309729 -0.23868746316409 0.933889320652286 0.95686512544345 0.923167449214218 0.938262672905075 0.927987055495867 0.804384622041746 0.755387690825715 0.69061794859489 0.799168813971237 0.981664648944823 0.980028049631411 0.822518712635579 0.389977867706632 0.413177122173678 0.778287379025987 0.831754466965638 0.838301213021834 0.806205121873889 0.936398708634361 0.942021511493969 0.625688253962559 0.55699742332338 0.571662597985599 0.14573999020333 0.573394968241394 0.576654425906503 0.398869410194453 0.989114391686792 0.989206545713797 0.955029778023174 0.944033857251378 0.947826515657725 0.655094683030827 0.867289238682357 0.900903334287525 0.841427624100966 0.801607433434634 0.899422896822327 0.936815590448862 0.729964083523095 0.726739689765965 0.417465449538043 0.88064458161592 0.790884092080477 -0.105712846162778 0.802759357444248 0.851078798082179 0.478581133532912 0.793640402240565 0.810286487642667 0.743786469559659 0.917288879606054 0.86340840557755 0.369205741953394 0.953234009642053 0.935810976322339 0.445539710614261 0.899329088961764 0.880882121197374 0.368203383223611 0.858152404682236 0.857931486900926 0.724860375615778 0.887007344373715 0.89522018159641 0.801728214732385 0.894446614202468 0.879183520437991 0.868017807615904 0.88057521454176 0.883166442307198 0.786275055976916 0.812661977494802 0.847163424420911 0.519171282735064 0.977364509289876 0.984078346312083 0.941162130658077 0.913791796924485 0.907290154111513 0.853746568475075 0.893820850248669 0.905253341518784 0.334944075757804 0.947207033282722 0.927813119539212 0.606609877876965 0.591852721750169 0.659380414913061 0.668275317686392 0.632150830994871 0.549032868911292 0.171036410348347 0.913491860539778 0.926687037774369 0.955149461398663 0.64372932032717 0.549177939259021 -0.0976447015293959 0.851402996439654 0.911277685485331 0.668928096995566 0.896041239122526 0.842071133102604 0.37168477663574 0.887725084719099 0.919397212457872 0.915127005681768 0.958535625879961 0.984384439946823 0.865666671060366 0.9132137699271 0.926539264441202 0.167510456346627 0.529482400428697 0.640876154871137 0.812345555605969 0.884407914038984 0.902066016788916 0.411129385059018 0.901726024729628 0.91555906760734 0.798692129232028 0.18527446033362 0.0600700662084203 -0.388296131667274 0.822984365167349 0.769698568403244 0.122462091590845 0.224561281138151 0.11424381699454 0.250347969383406 0.227200328563205 0.189515923536933 0.331944667594913 0.883198774964384 0.847243383522143 -0.20061716286739 0.96614427237246 0.946122620586884 0.597291838284792 0.98742933837798 0.989818735753617 0.992739491720362 0.826497053043542 0.850927884135209 0.764458144035584 0.724325954219174 0.711522867173892 -0.068952427619635 0.857939634088573 0.851782068717411 0.884396470371429 0.569061336324845 0.680277840562293 0.65182635354328 0.180157401711415 0.247614367809058 0.639469515523174 0.740271328638724 0.750409495974513 0.791223534541695 0.571275672916056 0.621079219836492 -0.331556247876282 0.895878006222555 0.884743319555557 0.719230483511387 0.716446945248617 0.723165673538956 0.63455780609071 0.806446098763262 0.783750332426866 0.847693830238861 0.422215450744414 0.266754427480224 -0.0395082991383703 0.675991517687166 0.627141706898815 0.262175103160616 0.93018250491955 0.934492194186752 0.980239926176182 0.910300986145596 0.926283890760333 0.198782514226278 0.966563743724197 0.960715556516159 0.360426816698208 0.956601932681935 0.960207975060109 0.905780187990252 0.860326376920018 0.904178152090367 0.479948221544713 0.933913790575163 0.957565257630784 0.973664000301269 0.983288118712902 0.984632843007335 0.976519810959786 0.707706035915681 0.695345207082196 0.464290938167869 0.635637670696925 0.593036875881164 0.258300118213274 0.910469737861561 0.933400726416255 0.936555769649377 0.80113777788379 0.773668065173729 0.0924595187672342 0.850121001682638 0.897959708720593 0.809279730778178 0.908942176163576 0.910532846808925 0.93493646418865 0.971985697008238 0.932169830701171 0.846749600359799 0.691535725968117 0.733811651907448 0.67161624047016 0.98552562845163 0.984068664058185 0.940820571625785 0.916951609656907 0.821586109329051 0.119099551143301 0.46117964439904 0.410065675142815 0.106257738539225 0.902042606606483 0.895544117014674 0.731494942437088 0.765661055888704 0.792271055063083 0.760069631188972 0.862496633756817 0.858443127558431 -0.116076677324252 0.914124417024414 0.925788471597196 0.907514972995215 0.835322692779021 0.905675309566821 0.915457414612235 0.789028115489812 0.806161502208667 0.301043569486432 0.922716497502188 0.918140153277542 0.728607889518921 0.953329963718796 0.907451445360189 0.831723258744987 0.92819353160837 0.950551394169309 0.946235951912858 0.985492244593593 0.985918098263225 0.968825746384126 0.86634991855342 0.917012658032671 0.921898003024084 0.882689984422356 0.874429531556395 0.678301646770887 0.916482511997418 0.954111190271235 0.923508792707393 0.916807717916139 0.937856045264684 0.955975009061982 0.888222547502927 0.919393956536214 0.638518374839936 0.856052460698184 0.818025809110532 -0.229617515247393 0.923034770291176 0.920710312511179 0.892845055268323 0.818290401259129 0.909843070016041 0.93586406238498 0.953720594700916 0.953994849243193 0.816515043457013 0.511440531220482 0.538053795301811 0.589849530576956 0.605501186040223 -0.0228436662825001 -0.135040021355679 0.891632222788353 0.902683124775782 0.85526082299321 0.904582325986931 0.922766221665608 0.943792606394739 0.810395253024632 0.785722491806082 0.763033708594915 0.904545728929661 0.920304664562146 0.797285817397717 0.97611908714468 0.981923583488444 0.860181253371643 -1 -1 1 0.903833606594683 0.77870450850662 0.795857905258942 0.899376998773305 0.722583028193165 0.21635594146685 0.943854408533885 0.921897320690533 0.514018469228247 0.318392582827541 0.299670754478365 -0.21382017178831 0.426773682793407 0.466287413270159 0.671555741272239 0.885042139923224 0.908469239450737 0.874086244398933 0.951758791577036 0.955309322528417 0.285021305653608
This query is offtopic for this list, as it is about statistics, not R programming. stats.stackexchange.com is a good venue for statistics questions. However, you are confused. Wilcoxon does NOT test for differences in population means. e.g. Consider the 2 samples: A: 5,6,7 B: 1,2, 50 Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Aug 22, 2017 at 9:20 AM, Karolis Uziela <karolis.uziela at gmail.com> wrote:> Hi, > > I am using wilcox.test function to test the difference between the means of > two samples. The data points are paired, so I am using a paired test. > > There is one strange case. Sample A has a higher mean than a sample B. > However, wilcox.test function says that sample B has a significantly higher > "mean rank" than sample A. How is it possible? > > Here is the code (data file is attached): > df <- read.table("wilcox_data.txt", head=TRUE) > mean(df$A) > [1] 0.7987849 > mean(df$B) > [1] 0.7977966 > mean(df$C) > [1] 0.6350737 > > wilcox.test(df$B, df$A, paired=TRUE, alternative="greater") > Wilcoxon signed rank test with continuity correction > > data: df$B and df$A > V = 134300, p-value = 3.299e-05 > alternative hypothesis: true location shift is greater than 0 > > wilcox.test(df$C, df$A, paired=TRUE, alternative="greater") > Wilcoxon signed rank test with continuity correction > > data: df$C and df$A > V = 41423, p-value = 1 > alternative hypothesis: true location shift is greater than 0 > > The p-value of the first test is rather low (3.299e-05), which indicates > that the alternative hypothesis is true - sample B has a higher "mean rank" > than sample A. Just to make sure I am not doing a dumb mistake, I added a > third variable C to this example, which is much smaller than A or B. As > expected, the second test has p-value = 1, which means that "mean rank" of > C is lower than A (null hypothesis is true). > > I am afraid, I am not very strong in statistics, but I would very much > appreciate if someone could explain me in simple words: > 1) Wikipedia says that Wilcoxon signed-rank test is used to test whether > population "mean ranks" differ. What is exactly the definition of "mean > rank"? https://en.wikipedia.org/wiki/Wilcoxon_signed-rank_test > 2) How can the mean of a variable A be bigger than the mean of variable B, > but the "mean rank" of variable B is significantly bigger than "mean rank" > of variable A. > > There is a small chance that this is because of a bug in wilcox.test > function, but it is probably more likely that this paradox is because of > some statistics phenomena that I don't understand. > > Best regards, > Karolis Uziela > > P. S. I have another strange example, where the difference between A and B > is much smaller than the difference between A and C, but the significance > of the "mean rank" difference between A and B is much larger then the > significance of mean rank difference between A and C. For simplicity > reasons, I didn't add that example here, but I guess that the answer to the > above question will be related to this one. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.
Possibly Parallel Threads
- Inconsistencies in wilcox.test
- exact Wilcoxon signed rank test with ties and the "no longer under development" exactRanksumTests package
- The three routines in R that calculate the wilcoxon signed-rank test give different p-values.......which is correct?
- Inconsistencies in wilcox.test
- Wilcoxon signed rank test and its requirements