Tuesday 3 September 2013

Wilcoxon Signed Rank Test

The Wilcoxon Signed Rank test is a non-parametric test for paired/matched samples, and can be regarded as the non-parametric counterpart to the Paired Student's  t-test.  A worked example follows.

Suppose we have two groups of matched samples:

Group 1: 1,2,4,5,6,7,8,3

Group 2: 2,5,1,3,9,10,3,3

We first find the difference between these matched samples (Group 1 sample - Group 2 sample)

Group 1     Group 2      Difference
1                  2                     -1    
2                  5                     -3
4                  1                    +3
5                  3                    +2
6                  9                     -3
7                10                     -3
8                  3                      5
3                  3                      0

We discard the case where there is 0 difference (the last pair), so that the sample size $N_r$ is $7$. Then, we sort the difference by absolute value and rank them, and highlight where there are ties (i.e. the same absolute values of the difference).

Rank      Difference
  1               -1
  2              +2
  3               -3
  4               -3
  5               -3
  6              +3
  7              +5

The ranks for the ties are averaged out, resulting in

Rank      Difference
  1               -1
  2              +2
  4.5            -3
  4.5            -3
  4.5            -3
  4.5           +3
  7              +5

Next we sum the ranks for the negative difference (which is $14.5$), and the sum of the positive difference can be found by subtracting 14.5 from the total rank ($7\times 8 \times 0.5=28$), which is $13.5$.

The value of $W$ (the Wilcoxon Signed-Rank statistic) is the lower of the (positive/negative) sum of the ranks, hence $13.5$.

We need to find the critical value of $W$, $Wcrit$, as there are only 7 samples, so that a z-score will be highly inaccurate. We do this by referring to a table for a two-tailed test at 5% level, and obtain $Wcrit=2$. As $W$ is greater than $Wcrit$, the result is not significant.

Even though the z-score will be inaccurate (on SciStatCalc, if the number of samples exceeds 25, the z-score is considered accurate enough, and the $Wcrit$ value is no longer used, to limit the size of the table storing $Wcrit$), it is nevertheless worth evaluating this as an exercise. The z-score is given by equation
$\Large \frac{W-\mu}{\sigma}$

where $\mu$ is the mean and $\sigma$ is the standard deviation.

The $\mu$ value is $\frac{Nr\times (N_r+1)}{4}$, and so will be $7\times 8\times 0.25 = 14$ for our example.

The $\sigma$ is given by $\sqrt{\frac{N_r(N_r+1)(2N_r+1)}{24}}$, and will be $\sqrt{7\times 8 \times 15 \times (1/24)}=5.9169$.

The z-score is thus $(13.5 - 14)/5.9169=-0.084515$, resulting in a p-value of 0.93, which is considerably larger than  the critical 0.05 value. The result is not significant by quite some margin.

Below is a screenshot of SciStatCalc with the results of the Wilcoxon signed rank test.

Wilcoxon Signed Rank test ios iphone app SciStatCalc


  

14 comments:

  1. HELLO everyone! Still don’t know the right words to express my Gratitude to the Great DR.Imoudu After been diagnosed with the #herpes for the passed 1 years, i was given so many health prescription and advice with no improvement, I totally lost hope, until i found many testimonies of Great DR.Imoudu in an online research Like anybody would be, i advice anyone that is living with herpes can also contact him today, because he has the cure to any virus problem contact him on WhatsApp +2348109609753..
    Or his Email: DR.IMOUDUHEALERTEMPLE@GMAIL. COM
    1...ALS CURE/DIABETES CURE/EPILESY/HPV CURE/LOOSE WEIGHT AND BODY/EX-BACK/HEPATITIS/
    THANK YOU DR.Imoudu FOR YOU GOOD WORK IN MY LIFE..


    ReplyDelete
    Replies
    1. I was having Herpes Simplex Virus then i came across a review of people saying that they got treated from Herpes Simplex Virus by Dr VOODOO., So i gave a try by contacting him through his email and explain my problem to him. He send natural medicine herbs to me and told me all the things I need to do and also give me instructions to take the medicine, which I followed properly. Before I knew what is happening after two weeks the HERPES SIMPLEX VIRUS that was in my body got vanished . so if you are also heart broken by any deadly diseases like HERPES HIV, shingles,low sperm count or bringing back your ex lover, this great man is extremely the best in which I have seen if you also need a help, you can also email him at voodoospelltemple66@gmail.com Add Dr voodoo on whatsApp +2348140120719

      Delete
  2. Am really happy that i have been cured from HSV1&2 DISEASE with the herbal medicine of Dr otaigbe have been suffering from this disease for a long time now without solution until i came across the email of this doctor who have cure so many people with his herbal medicine, i also choose to give him a chance to help me, he told me what to do and i kindly did it, and he gave me his herbal medicine and direct me on how to use it, i also follow his instructions for use and he ask me to go for a check up after 3 months which i did, to my greatest surprise my result came out as negative, i am really happy that there is someone like this doctor who is ready to help anytime any day. To all the readers and viewers that is doubting this testimony stop doubting it and contact this doctor if you have any disease and see if he will not actually help you. I know that there are some people out there who are really suffering and hurting their family just because of these diseases. you can get to him through email:DROTAIGBESPELLHOME@GMAIL. COM or WhatsApp him +2349066103332 .

    ReplyDelete
  3. All thanks to Dr Raymond for helping me to get my penis longer and bigger with his cream in just two week his cream is very active and also it work fast for everyone who have used it, the best thing about his herbal cream is that it does not have side effects and the results is permanent. Note he can also cure the below sicknesses and disease PREMATURE EJACULATIONLOW SPERM COUNTERECTILE DYSFUNCTIONHIV/AIDS CUREHERPES CUREINFECTION CUREPILESTROKEHEART FAILUREYou can email him if you need his help via: drraymondherbalcenter@gmail.com or WhatsApp him via: +2348116744524

    ReplyDelete
  4. TESTIMONY ON HOW I GOT CURED TOTALLY FROM HERPES VIRUS BY DR ISHIAKU HERBS

    I want to inform the public how I was cured of herpes  Virus by a Doctor called Dr ISHIAKU. I visited different hospitals but they gave me a list of drugs like Famvir, Zovirax, and Valtrex which are very expensive to treat the symptoms and never cured me. I was browsing through the Internet searching for remedies on Herpes and I saw comments of people talking about how Doctor ishiaku cured them. I Was scared because I never believed in the Internet but I was convinced to give him a try because I had no hope of being cured of herpes so I decided to contact him on his email, i searched his email on the net and I saw a lot of people testifying about his goodness. When I contacted him he gave me hope and sent a Herbal medicine to me that I took and it seriously worked for me, am a free person now without any problems, my HERPES result came out negative. You can contact him on his email: (ishiakuherbalcure@yahoo.com)or what - sapp him via (+2348180828544) and get all your problems solved.

    1)Sickness of any kind
    2)Help to cure  HEPATITIS B, DIABETICS, HIV
    3)Marriage problem, To Re-unit or to cast a spell
    4)Pregnancy problem
    5)Financial problem and Job promotion
    6)bad mouth odour or tooth problem
    7)eye or ear problem
    8) enlargement of manhood

    Website: www.ishiakuherbalcure.Wordpress.com

    ReplyDelete
  5. Hello everyone. Dr Ishiaku herbs is a good remedy for herpes Virus , I was a carrier of herpes virus and I saw a testimony on how Dr. Ishiaku cure Herpes Virus, I decided to contact him, I contacted him and he guided me. I asked him for solutions and he started the remedies for my health. After he finish he sent me the herbs which i took for 2 weeks before asking me to go for a check up and getting there i could not believe that i was confirm HSV 2 Negative after the test, Today i am so happy because I'm free from herpes disease with the help of Dr. Ishiaku . Thank God now everything is fine, I'm cured by Dr. Ishiaku herbal medicine, I'm very thankful to God for making it possible. you can reach him on his email, i strongly recommend him to any one out here looking for a cure to herpes or any other deadly disease...Contact Dr ishiaku via email: ishiakuherbalcure@yahoo.com or whats-app +2348180828544

    ReplyDelete
  6. God is Good! I promised God that I would share my testimony on this blog. I had all the signs of STD Virus but I was not too sure as to which one. I did a lot of online research and scared myself straight for a whole week before going to see the nurse. She took one look at my genital part and first said that it could just be the anatomy of my body, then she said it looked like genital warts and that I may have herpes. I was devastated. She gave me some medicine for the herpes and some cream for the warts. I was also tested for every single STD including herpes. I went home and cried searching the web for all sorts of cures for herpes and awaiting my results. I saw a post whereby Dr. Oyagu cured Herpes and other diseases, I copied his contacts out and added him on whats app via (+2348101755322). The next day my test result was ready and i confirmed Herpes positive. I told Dr.Oyagu about my health problems and he assured me of cure. He prepared his herbal medicine and sent it to me. I took it for 14 days (2 weeks). Before the completion of the 14 days in which I completed the dose, the Blisters and Warts that were on my body was cleared. I went back for check-up and I was told I'm free from the virus. Dr. Oyagu cures all types of diseases and viruses with the help of his herbal medicine. You can reach Dr. Oyagu via his email address on (oyahuherbalhome@gmail.com) or WhatsApp him on (+2348101755322) Visit His website on https://oyaguspellcaster.wixsite.com/oyaguherbalhome

    ReplyDelete
  7. Natural Herbal Medicine To Cure {HERPES DISEASE} TOTALLY HERE
    Do you need a solution to cure your Herpes Disease contact Dr Idedia to help and he will surely help you to cure your Herpes disease .. I have suffered from Herpes-2 for 4years ago which almost took my life. But one day I was searching the internet and I found Dr Idedia saw so many testimonies on how Dr Idedia helps people in curing their deadly diseases, and I contacted Dr Idedia asked him for solutions and he started the remedies for my health. He prepared herbal medicine for me and I received the herbal medicine and after using it for 2 weeks my condition has greatly improved, all my symptoms including Abdominal pain, Nausea and vomiting, Loss of appetite stopped, so I went to my doc and was confirmed negative. I am Herpes disease free! contact the herbal doctor via his email> dr.idediatraditionalhealinghome@gmail.com or his cell number / WhatsApp> +2349126592869

    ReplyDelete
  8. It’s obvious some patient with HERPES are been enslaved to the antiviral and other supplementary Orthodox medicine just to help suppress the virus and not a cure. I have been with the virus since 2020 until I was introduce by a blogger who also narrated Her story online on how she was cured of Herpes after using Dr ISHIAKU Herbal Medicine. This is a year and 2 weeks since I was delivered from Herpes. All thanks to God for using this Great herbalist to heal me. I have promise to keep telling good about this. Please fill free to share Your problems with him. Thanks. Write him via call or whatsapp him on +2348180828544 or email ishiakuherbalcure@yahoo.com   thank you once again sir

    ReplyDelete
  9. It’s obvious some patient with HERPES are been enslaved to the antiviral and other supplementary Orthodox medicine just to help suppress the virus and not a cure. I have been with the virus since 2020 until I was introduce by a blogger who also narrated Her story online on how she was cured of Herpes after using Dr ISHIAKU Herbal Medicine. This is a year and 2 weeks since I was delivered from Herpes. All thanks to God for using this Great herbalist to heal me. I have promise to keep telling good about this. Please fill free to share Your problems with him. Thanks. Write him via call or whatsapp him on +2348180828544 or email ishiakuherbalcure@yahoo.com   thank you once again sir

    ReplyDelete
  10. I got diagnose of herpes virus last year, and i was taking some drugs prescribed for me by my family doc the drugs could not work and the herpes in my system was very terrifying that i was so depressed the good news is that i never gave up in searching for natural cure for herpes virus ,cause i believe so much in herbal medication.. One faithful morning i read a comment from a lady called Destiny Hudson on how she was cured with natural herbs made by DR.OYAGU from somewhere is West Africa, i immediately copied out his contact email via oyaguherbalhome@gmail.com and explain all my herpes problem to him via his email. the big truth is that it took just two week for his herbal medication to cure me completely without side affect. Till date am herpes virus free and all thanks to Dr OYAGU for his good deeds for me, Once again am very happy to share this great testimony of DR OYAGU cure hurry up now and contact him via his email address (oyaguherbalhome@gmail.com Call & WhatsApp him on (+2348101755322 ) and see what he can do

    ReplyDelete

  11. Hi, this is real testimony of a spell doctor who helped me bring back my finance, who left i and the kids for 9 month. i had lost all hope about my finance coming back home again. if you're going through a tough time in your marriage or relationship, or want back your Ex. contact him on email address: drozoeyspellhome@gmail.com or WhatsApp him ‪+2349056460552‬

    ReplyDelete

  12. Hi, this is real testimony of a spell doctor who helped me bring back my finance, who left i and the kids for 9 month. i had lost all hope about my finance coming back home again. if you're going through a tough time in your marriage or relationship, or want back your Ex. contact him on email address: drozoeyspellhome@gmail.com or WhatsApp him ‪+2349056460552‬

    ReplyDelete
  13. I am here to give my testimony about a doctor who saved my life. i was infected with HERPES for more than 2 years, I tried different doctors over a period of time but no one work, but when i came on the Internet i saw great testimony about DR Enato how he was able to cure someone from HERPES virus with the help of herbal medicine I contacted him and he promised to cure my herpes virus.well i decided to give him a try, DR Enato put his best in it and gave me good and effective result just as he has promised. Well after taking all the treatment sent to me by Dr Enato i went back to the Hospital for check up, and now i have been confirmed HERPES Negative. You can contact him if you have any kind of sickness like, HERPES, HIV, CANCER, PILE, HEPATITIS, DIABETES, and alot more you can contact him ON WhatsApp (+2348071351544) or Email dr.enatoherbalcure@gmail.com His website is https://drenatoherbalcure.simdif.com

    ReplyDelete

Logistic Regression Calculator and ROC Curve Plotter

This blog post implements a Logistic Regression calculator for a binary output. Consider a binary outcome response variable \(Y\...