SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
Expand all | Collapse all

Hodges-Lehmann test for median difference

  • 1.  Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 09:22 AM
    Are there command steps or syntax code for conducting a Hodges-Lehmann test in SPSS?

    Thanks,
    Cliff


  • 2.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 02:12 PM
    I am away from my computer and don't recall whether this is built in, but using the STATS CARTPROD extension command, it would be pretty easy to construct this.





  • 3.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 02:49 PM

    Jon:

    Thanks for the quick reply. I need to access the STATS CARTPROD extension command. Can you provide instructions or directions on how to do so? From what little I know, the procedure is done through Python or R as an extension of SPSS, but please confirm and direct me. 

    Thanks a bunch.

    Cliff



    ------------------------------
    Clifton Hamilton
    ------------------------------



  • 4.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 03:53 PM
    You can install any extension command via Extensions > Extension Hub.  The dialog box will appear on Transform or Data.  I forget which.

    There is a Wikipedia article - Google Hodges-Lehman on how to compute it from the Cartesian product.  I won't be back to my computer until Wednesday.






  • 5.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 04:20 PM
    Thanks much. Enjoy your mini vacation. Cliff





  • 6.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 05:36 PM
    Hi Jon,
    I made the extension and up and running a Cartesian product but am stumped on how to enter an Output Data File. I have tried everything. Suggestions? I know the answer will probably be simple. 
    Cliff





  • 7.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 05:39 PM
    Doesn't it just need a name for a new dataset that will hold the result?






  • 8.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 05:59 PM
    That's what I thought too. I am using the name of the file on which the left and right data set are saved on. I'll keep hammering away at this. I thought I had to include the suffix .sav or use the familiar coding of a hard drive such as C:\User\ ... etc. but it must be much simpler. 





  • 9.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 06:00 PM
    Try just entering Fred





  • 10.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 06:12 PM

    Sanford or Flintstone? I'll keep trying until something works. I'll let you know via a new post when I solve it. Cliff



    ------------------------------
    Clifton Hamilton
    ------------------------------



  • 11.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 06:23 PM
    What works is just BROWSE for an existing file. I have output! Unfortunately, the output is indecipherable as I asked for it to be uploaded in Word. Next task: Uploading output in a readable format. Suggestions? 





  • 12.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 06:31 PM
    The output from CARTPROD would just be a data file





  • 13.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 06:37 PM

    Correct. I get a data file of all the m and n pairings. I do not get the result, which is -2 because I actually conducted the Hodges-Lehmann by hand before trying on SPSS. I also get a dummy file that, when asked to be open in SPSS, nothing appears. 



    ------------------------------
    Clifton Hamilton
    ------------------------------



  • 14.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 06:42 PM

    I am wondering if I am suffering from some software malfunction. Please let me know later in the week if you can have further guidance. Or once I get the m and n pairings, am I supposed to conduct another test? In other words, does CARTPROD simply provide the pairings? Then what?

    Thanks, Cliff. 



    ------------------------------
    Clifton Hamilton
    ------------------------------



  • 15.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 06:57 PM
    Look at the Wikipedia definition again.  CARTPROD just gives you all the pairs.  Then you have to compute the median difference over that dataset.





  • 16.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 07:03 PM

    Wow. I overlooked that portion. Here I go, once more unto the breach...Thanks much AGAIN. Cliff



    ------------------------------
    Clifton Hamilton
    ------------------------------



  • 17.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 07:30 PM

    Success! Once I transformed the m and n pairings (from CARTPROD) into a Difference variable, the Descriptive and Explores option provided me with the median difference. Thanks for all of your assistance. Cliff



    ------------------------------
    Clifton Hamilton
    ------------------------------



  • 18.  RE: Hodges-Lehmann test for median difference

    Posted Sun October 08, 2023 08:47 PM
    Congratulations!





  • 19.  RE: Hodges-Lehmann test for median difference

    Posted Mon October 09, 2023 12:54 PM

    The Hodges-Lehmann test is a statistical test used to assess whether there is a significant difference between the medians of two independent groups or samples. It's a non-parametric test, meaning it doesn't rely on assumptions about the distribution of the data. Instead, it focuses on the central tendency, specifically the median.

    Here's a simplified step-by-step explanation of how to conduct the Hodges-Lehmann test for median difference:   
    [Replica Swords](https://replicaswords.us/)

    1. Data Collection: Collect your data for the two groups you want to compare. This data should be continuous or ordinal in nature.

    2. Pairwise Comparisons: For each pair of observations, calculate the difference between the values from the two groups. You will end up with a list of these differences.

    3. Rank Differences: Rank the absolute differences in ascending order, assigning a rank to each difference, while considering tied values. This is often done in a way that maintains the signs (positive or negative) of the differences.

    4. Calculate the Test Statistic: The test statistic is the sum of the ranks of the positive differences. It indicates whether one group tends to have higher values than the other. The larger the test statistic, the stronger the evidence for a difference in medians.

    5. Hypothesis Testing: You can then perform a hypothesis test, typically using the Wilcoxon signed-rank test or Mann-Whitney U test. These tests assess whether the test statistic is significantly different from what would be expected under the null hypothesis (that there's no difference in medians).

    6. Interpretation: If the p-value from the hypothesis test is less than your chosen significance level (e.g., 0.05), you can conclude that there is a significant difference in medians between the two groups.

    The Hodges-Lehmann test is particularly useful when you have data that may not meet the assumptions of parametric tests (like the t-test) or when you want to assess the median difference rather than the mean difference. It's a robust method for comparing central tendencies.



    ------------------------------
    marinda cohen
    ------------------------------