Mann-Whitney U question

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Mann-Whitney U question

Salbod
Dear Friend,

Is there anyway, using SPSS, to generate Confidence Intervals for the
Mann-Whitney U test?

Thank you.

Stephen Salbod, Pace University, NYC





--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Mann-Whitney U question

Jon Peck
If you have the Exact Tests option, you can use the legacy procedure to get a CI for Mann-Whitney with syntax like this, which uses a Monte Carlo method.  This is supported in the Legacy dialog box.

NPAR TESTS
  /M-W= educ BY minority(0 1)
  /METHOD= MC CIN(95) SAMPLES(10000).

Without Exact Tests, you can use the asymptotic standard error and appeal to asymptotic normality.



On Thu, Apr 12, 2018 at 6:31 PM, Salbod <[hidden email]> wrote:
Dear Friend,

Is there anyway, using SPSS, to generate Confidence Intervals for the
Mann-Whitney U test?

Thank you.

Stephen Salbod, Pace University, NYC





--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD



--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Mann-Whitney U question

Salbod
Dear Jon,

Thank you for the quick solution. Steve

Sent from my iPad

On Apr 12, 2018, at 9:21 PM, Jon Peck <[hidden email]> wrote:

If you have the Exact Tests option, you can use the legacy procedure to get a CI for Mann-Whitney with syntax like this, which uses a Monte Carlo method.  This is supported in the Legacy dialog box.

NPAR TESTS
  /M-W= educ BY minority(0 1)
  /METHOD= MC CIN(95) SAMPLES(10000).

Without Exact Tests, you can use the asymptotic standard error and appeal to asymptotic normality.



On Thu, Apr 12, 2018 at 6:31 PM, Salbod <[hidden email]> wrote:
Dear Friend,

Is there anyway, using SPSS, to generate Confidence Intervals for the
Mann-Whitney U test?

Thank you.

Stephen Salbod, Pace University, NYC





--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD



--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Mann-Whitney U question

Bruce Weaver
Administrator
In reply to this post by Jon Peck
I've pasted code for an example below.  What Jon has suggested gives a CI for
the p-value.  Is that what you were asking for Stephen?  


* Example from
https://www.statsdirect.co.uk/help/nonparametric_methods/mann_whitney.htm.
NEW FILE.
DATASET CLOSE ALL.
DATA LIST LIST / Farm(F1) Score(F5.1).
BEGIN DATA
1 14.8
1 7.3
1 5.6
1 6.3
1 9.0
1 4.2
1 10.6
1 12.5
1 12.9
1 16.1
1 11.4
1 2.7
0 12.7
0 14.2
0 12.6
0 2.1
0 17.7
0 11.8
0 16.9
0 7.9
0 16.0
0 10.6
0 5.6
0 5.6
0 7.6
0 11.3
0 8.3
0 6.7
0 3.6
0 1.0
0 2.4
0 6.4
0 9.1
0 6.7
0 18.6
0 3.2
0 6.2
0 6.1
0 15.3
0 10.6
0 1.8
0 5.9
0 9.9
0 10.6
0 14.8
0 5.0
0 2.6
0 4.0
END DATA.

NPAR TESTS
  /M-W= Score BY Farm(0 1)
  /METHOD= MC CIN(95) SAMPLES(10000).

From the output table:

Mann-Whitney U:  189.000
Wilcoxon W:  855.000

z = -.643, p = .520
Monte Carlo two-tailed p = .513, 95% CI .503 to .523
Monte Carlo one-tailed p = .253, 95% CI .245 to .262



Jon Peck wrote

> If you have the Exact Tests option, you can use the legacy procedure to
> get
> a CI for Mann-Whitney with syntax like this, which uses a Monte Carlo
> method.  This is supported in the Legacy dialog box.
>
> NPAR TESTS
>   /M-W= educ BY minority(0 1)
>   /METHOD= MC CIN(95) SAMPLES(10000).
>
> Without Exact Tests, you can use the asymptotic standard error and appeal
> to asymptotic normality.
>
>
>
> On Thu, Apr 12, 2018 at 6:31 PM, Salbod &lt;

> ssalbod@

> &gt; wrote:
>
>> Dear Friend,
>>
>> Is there anyway, using SPSS, to generate Confidence Intervals for the
>> Mann-Whitney U test?
>>
>> Thank you.
>>
>> Stephen Salbod, Pace University, NYC
>>
>>
>>
>>
>>
>> --
>> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
>> command. To leave the list, send the command
>> SIGNOFF SPSSX-L
>> For a list of commands to manage subscriptions, send the command
>> INFO REFCARD
>>
>
>
>
> --
> Jon K Peck

> jkpeck@

>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
Reply | Threaded
Open this post in threaded view
|

Re: Mann-Whitney U question

bdates

If you want the actual confidence interval of the median, and not for the p-value, you can use Analyze>Descriptives>Ratio. Using Bruce's data compute a third variable, e.g., denom, to use as the denominator for the ratio test. Use compute denom=1 . Then either run the analysis from the GUI or the syntax below.


RATIO STATISTICS Score WITH denom BY Farm (ASCENDING)
  /MISSING=EXCLUDE
  /PRINT=CIN(95) COD MDCOV MEAN MEDIAN PRD.


You'll get medians and confidence intervals for both groups and for the overall score. Because it's based on ranks, you'll need to round to the closest rank to get the 95% CI, or in the case of medians the approximate 95% CI.


Brian


From: SPSSX(r) Discussion <[hidden email]> on behalf of Bruce Weaver <[hidden email]>
Sent: Friday, April 13, 2018 10:13:14 AM
To: [hidden email]
Subject: Re: Mann-Whitney U question
 
I've pasted code for an example below.  What Jon has suggested gives a CI for
the p-value.  Is that what you were asking for Stephen? 


* Example from
https://www.statsdirect.co.uk/help/nonparametric_methods/mann_whitney.htm.
NEW FILE.
DATASET CLOSE ALL.
DATA LIST LIST / Farm(F1) Score(F5.1).
BEGIN DATA
1 14.8
1 7.3
1 5.6
1 6.3
1 9.0
1 4.2
1 10.6
1 12.5
1 12.9
1 16.1
1 11.4
1 2.7
0 12.7
0 14.2
0 12.6
0 2.1
0 17.7
0 11.8
0 16.9
0 7.9
0 16.0
0 10.6
0 5.6
0 5.6
0 7.6
0 11.3
0 8.3
0 6.7
0 3.6
0 1.0
0 2.4
0 6.4
0 9.1
0 6.7
0 18.6
0 3.2
0 6.2
0 6.1
0 15.3
0 10.6
0 1.8
0 5.9
0 9.9
0 10.6
0 14.8
0 5.0
0 2.6
0 4.0
END DATA.

NPAR TESTS
  /M-W= Score BY Farm(0 1)
  /METHOD= MC CIN(95) SAMPLES(10000).

From the output table:

Mann-Whitney U:  189.000
Wilcoxon W:  855.000

z = -.643, p = .520
Monte Carlo two-tailed p = .513, 95% CI .503 to .523
Monte Carlo one-tailed p = .253, 95% CI .245 to .262



Jon Peck wrote
> If you have the Exact Tests option, you can use the legacy procedure to
> get
> a CI for Mann-Whitney with syntax like this, which uses a Monte Carlo
> method.  This is supported in the Legacy dialog box.
>
> NPAR TESTS
>   /M-W= educ BY minority(0 1)
>   /METHOD= MC CIN(95) SAMPLES(10000).
>
> Without Exact Tests, you can use the asymptotic standard error and appeal
> to asymptotic normality.
>
>
>
> On Thu, Apr 12, 2018 at 6:31 PM, Salbod &lt;

> ssalbod@

> &gt; wrote:
>
>> Dear Friend,
>>
>> Is there anyway, using SPSS, to generate Confidence Intervals for the
>> Mann-Whitney U test?
>>
>> Thank you.
>>
>> Stephen Salbod, Pace University, NYC
>>
>>
>>
>>
>>
>> --
>> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
>> command. To leave the list, send the command
>> SIGNOFF SPSSX-L
>> For a list of commands to manage subscriptions, send the command
>> INFO REFCARD
>>
>
>
>
> --
> Jon K Peck

> jkpeck@

>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Mann-Whitney U question

Thomas MacFarland

Greetings:

 

You can also use R to easily obtain the desired statistics:

 

install.packages("coin")

library(coin)                  # Load the coin package.

help(package=coin)             # Show the information page.

sessionInfo()                  # Confirm all attached packages.

# Select the most local mirror site using Set CRAN mirror.

 

coin::wilcox_test(Judgment ~ Treatment.recode,

  data = Goats.df,

  distribution = "exact", conf.int = TRUE)

  # Note the use of ~ between the two object variables

 

Look at https://www.springer.com/us/book/9783319306339 and more specifically the chapter on Mann-Whitney for more detail if the above syntax is not sufficient.

 

BTW, the Goats.df dataset is available as a free download.  Just click on ESM files and then select Chapter 4 when the file(s) open.

 

Best wishes.

 

Tom MacFarland

----------

Thomas W. MacFarland, Ed.D.

Senior Research Associate; Institutional Effectiveness and Associate Professor

Nova Southeastern University

Voice 954-262-5395 [hidden email]

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Dates, Brian
Sent: Friday, April 13, 2018 11:05 AM
To: [hidden email]
Subject: Re: Mann-Whitney U question

 

If you want the actual confidence interval of the median, and not for the p-value, you can use Analyze>Descriptives>Ratio. Using Bruce's data compute a third variable, e.g., denom, to use as the denominator for the ratio test. Use compute denom=1 . Then either run the analysis from the GUI or the syntax below.

 

RATIO STATISTICS Score WITH denom BY Farm (ASCENDING)
  /MISSING=EXCLUDE
  /PRINT=CIN(95) COD MDCOV MEAN MEDIAN PRD.

 

You'll get medians and confidence intervals for both groups and for the overall score. Because it's based on ranks, you'll need to round to the closest rank to get the 95% CI, or in the case of medians the approximate 95% CI.

 

Brian


From: SPSSX(r) Discussion <[hidden email]> on behalf of Bruce Weaver <[hidden email]>
Sent: Friday, April 13, 2018 10:13:14 AM
To: [hidden email]
Subject: Re: Mann-Whitney U question

 

I've pasted code for an example below.  What Jon has suggested gives a CI for
the p-value.  Is that what you were asking for Stephen? 


* Example from
https://www.statsdirect.co.uk/help/nonparametric_methods/mann_whitney.htm.
NEW FILE.
DATASET CLOSE ALL.
DATA LIST LIST / Farm(F1) Score(F5.1).
BEGIN DATA
1 14.8
1 7.3
1 5.6
1 6.3
1 9.0
1 4.2
1 10.6
1 12.5
1 12.9
1 16.1
1 11.4
1 2.7
0 12.7
0 14.2
0 12.6
0 2.1
0 17.7
0 11.8
0 16.9
0 7.9
0 16.0
0 10.6
0 5.6
0 5.6
0 7.6
0 11.3
0 8.3
0 6.7
0 3.6
0 1.0
0 2.4
0 6.4
0 9.1
0 6.7
0 18.6
0 3.2
0 6.2
0 6.1
0 15.3
0 10.6
0 1.8
0 5.9
0 9.9
0 10.6
0 14.8
0 5.0
0 2.6
0 4.0
END DATA.

NPAR TESTS
  /M-W= Score BY Farm(0 1)
  /METHOD= MC CIN(95) SAMPLES(10000).

From the output table:

Mann-Whitney U:  189.000
Wilcoxon W:  855.000

z = -.643, p = .520
Monte Carlo two-tailed p = .513, 95% CI .503 to .523
Monte Carlo one-tailed p = .253, 95% CI .245 to .262



Jon Peck wrote
> If you have the Exact Tests option, you can use the legacy procedure to
> get
> a CI for Mann-Whitney with syntax like this, which uses a Monte Carlo
> method.  This is supported in the Legacy dialog box.
>
> NPAR TESTS
>   /M-W= educ BY minority(0 1)
>   /METHOD= MC CIN(95) SAMPLES(10000).
>
> Without Exact Tests, you can use the asymptotic standard error and appeal
> to asymptotic normality.
>
>
>
> On Thu, Apr 12, 2018 at 6:31 PM, Salbod &lt;

> ssalbod@

> &gt; wrote:
>
>> Dear Friend,
>>
>> Is there anyway, using SPSS, to generate Confidence Intervals for the
>> Mann-Whitney U test?
>>
>> Thank you.
>>
>> Stephen Salbod, Pace University, NYC
>>
>>
>>
>>
>>
>> --
>> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> [hidden email]

>  (not to SPSSX-L), with no body text except the
>> command. To leave the list, send the command
>> SIGNOFF SPSSX-L
>> For a list of commands to manage subscriptions, send the command
>> INFO REFCARD
>>
>
>
>
> --
> Jon K Peck

> jkpeck@

>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> [hidden email]

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Mann-Whitney U question

Jon Peck
Probably, the ci I pointed out is not what  you want as it pertains to the Monte Carlo distribution.  If you use the R  approach, here is a gentler way to do this in Statistics.

First, install the coin package (one time).  This will prompt you for a location.  Choose some US location from the list that appears.

begin program r.
install.packages("coin")
end program.

To run the test and get a ci for the shift in the distributions, first make sure that the group variable measurement level is set to nominal or ordinal.  Then run this code (using Bruce's data).

begin program r.
library(coin)
data= spssdata.GetDataFromSPSS(factorMode="levels")
wilcox_test(Score~Farm, data=data, conf.int=TRUE, distribution="exact")
end program.


On Fri, Apr 13, 2018 at 9:21 AM, Thomas MacFarland <[hidden email]> wrote:

Greetings:

 

You can also use R to easily obtain the desired statistics:

 

install.packages("coin")

library(coin)                  # Load the coin package.

help(package=coin)             # Show the information page.

sessionInfo()                  # Confirm all attached packages.

# Select the most local mirror site using Set CRAN mirror.

 

coin::wilcox_test(Judgment ~ Treatment.recode,

  data = Goats.df,

  distribution = "exact", conf.int = TRUE)

  # Note the use of ~ between the two object variables

 

Look at https://www.springer.com/us/book/9783319306339 and more specifically the chapter on Mann-Whitney for more detail if the above syntax is not sufficient.

 

BTW, the Goats.df dataset is available as a free download.  Just click on ESM files and then select Chapter 4 when the file(s) open.

 

Best wishes.

 

Tom MacFarland

----------

Thomas W. MacFarland, Ed.D.

Senior Research Associate; Institutional Effectiveness and Associate Professor

Nova Southeastern University

Voice 954-262-5395 [hidden email]

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Dates, Brian
Sent: Friday, April 13, 2018 11:05 AM


To: [hidden email]
Subject: Re: Mann-Whitney U question

 

If you want the actual confidence interval of the median, and not for the p-value, you can use Analyze>Descriptives>Ratio. Using Bruce's data compute a third variable, e.g., denom, to use as the denominator for the ratio test. Use compute denom=1 . Then either run the analysis from the GUI or the syntax below.

 

RATIO STATISTICS Score WITH denom BY Farm (ASCENDING)
  /MISSING=EXCLUDE
  /PRINT=CIN(95) COD MDCOV MEAN MEDIAN PRD.

 

You'll get medians and confidence intervals for both groups and for the overall score. Because it's based on ranks, you'll need to round to the closest rank to get the 95% CI, or in the case of medians the approximate 95% CI.

 

Brian


From: SPSSX(r) Discussion <[hidden email]> on behalf of Bruce Weaver <[hidden email]>
Sent: Friday, April 13, 2018 10:13:14 AM
To: [hidden email]
Subject: Re: Mann-Whitney U question

 

I've pasted code for an example below.  What Jon has suggested gives a CI for
the p-value.  Is that what you were asking for Stephen? 


* Example from
https://www.statsdirect.co.uk/help/nonparametric_methods/mann_whitney.htm.
NEW FILE.
DATASET CLOSE ALL.
DATA LIST LIST / Farm(F1) Score(F5.1).
BEGIN DATA
1 14.8
1 7.3
1 5.6
1 6.3
1 9.0
1 4.2
1 10.6
1 12.5
1 12.9
1 16.1
1 11.4
1 2.7
0 12.7
0 14.2
0 12.6
0 2.1
0 17.7
0 11.8
0 16.9
0 7.9
0 16.0
0 10.6
0 5.6
0 5.6
0 7.6
0 11.3
0 8.3
0 6.7
0 3.6
0 1.0
0 2.4
0 6.4
0 9.1
0 6.7
0 18.6
0 3.2
0 6.2
0 6.1
0 15.3
0 10.6
0 1.8
0 5.9
0 9.9
0 10.6
0 14.8
0 5.0
0 2.6
0 4.0
END DATA.

NPAR TESTS
  /M-W= Score BY Farm(0 1)
  /METHOD= MC CIN(95) SAMPLES(10000).

From the output table:

Mann-Whitney U:  189.000
Wilcoxon W:  855.000

z = -.643, p = .520
Monte Carlo two-tailed p = .513, 95% CI .503 to .523
Monte Carlo one-tailed p = .253, 95% CI .245 to .262



Jon Peck wrote
> If you have the Exact Tests option, you can use the legacy procedure to
> get
> a CI for Mann-Whitney with syntax like this, which uses a Monte Carlo
> method.  This is supported in the Legacy dialog box.
>
> NPAR TESTS
>   /M-W= educ BY minority(0 1)
>   /METHOD= MC CIN(95) SAMPLES(10000).
>
> Without Exact Tests, you can use the asymptotic standard error and appeal
> to asymptotic normality.
>
>
>
> On Thu, Apr 12, 2018 at 6:31 PM, Salbod &lt;

> ssalbod@

> &gt; wrote:
>
>> Dear Friend,
>>
>> Is there anyway, using SPSS, to generate Confidence Intervals for the
>> Mann-Whitney U test?
>>
>> Thank you.
>>
>> Stephen Salbod, Pace University, NYC
>>
>>
>>
>>
>>
>> --
>> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> [hidden email]

>  (not to SPSSX-L), with no body text except the
>> command. To leave the list, send the command
>> SIGNOFF SPSSX-L
>> For a list of commands to manage subscriptions, send the command
>> INFO REFCARD
>>
>
>
>
> --
> Jon K Peck

> jkpeck@

>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> [hidden email]

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD



--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Mann-Whitney U question

Bruce Weaver
Administrator
I wondered if Stephen was thinking about a CI for the parameter that Ronán
Conroy describes in his Stata Journal article on the Mann-Whitney U
test--i.e., the probability that a randomly drawn X is greater than a
randomly drawn Y.  Stata's -ranksum- command has an option (porder) to
estimate that parameter, but does not report a CI for it.  I am not aware of
any direct & easy way to compute that parameter or a CI for it using SPSS.  

https://www.stata-journal.com/sjpdf.html?articlenum=st0253



Jon Peck wrote

> Probably, the ci I pointed out is not what  you want as it pertains to the
> Monte Carlo distribution.  If you use the R  approach, here is a gentler
> way to do this in Statistics.
>
> First, install the coin package (one time).  This will prompt you for a
> location.  Choose some US location from the list that appears.
>
> begin program r.
> install.packages("coin")
> end program.
>
> To run the test and get a ci for the shift in the distributions, first
> make
> sure that the group variable measurement level is set to nominal or
> ordinal.  Then run this code (using Bruce's data).
>
> begin program r.
> library(coin)
> data= spssdata.GetDataFromSPSS(factorMode="levels")
> wilcox_test(Score~Farm, data=data, conf.int=TRUE, distribution="exact")
> end program.
>
>
> On Fri, Apr 13, 2018 at 9:21 AM, Thomas MacFarland &lt;

> tommac@

> &gt; wrote:
>
>> Greetings:
>>
>>
>>
>> You can also use R to easily obtain the desired statistics:
>>
>>
>>
>> *install.packages**("coin")*
>>
>> *library(coin)                  # Load the coin package.*
>>
>> *help(package=coin)             # Show the information page.*
>>
>> *sessionInfo**()                  # Confirm all attached packages.*
>>
>> *# Select the most local mirror site using Set CRAN mirror.*
>>
>>
>>
>> *coin::wilcox_test(Judgment ~ Treatment.recode,*
>>
>> *  data = Goats.df,*
>>
>> *  distribution = "exact", conf.int &lt;http://conf.int&gt; = TRUE)*
>>
>> *  # Note the use of ~ between the two object variables*
>>
>>
>>
>> Look at https://www.springer.com/us/book/9783319306339 and more
>> specifically the chapter on Mann-Whitney for more detail if the above
>> syntax is not sufficient.
>>
>>
>>
>> BTW, the Goats.df dataset is available as a free download.  Just click on
>> *ESM
>> files
>> &lt;http://www.springer.com/cda/content/document/cda_downloaddocument/MacFarland.zip?SGWID=0-0-45-1578079-p179875955&gt;*
>> and
>> then select Chapter 4 when the file(s) open.
>>
>>
>>
>> Best wishes.
>>
>>
>>
>> Tom MacFarland
>>
>> ----------
>>
>> Thomas W. MacFarland, Ed.D.
>>
>> Senior Research Associate; Institutional Effectiveness and Associate
>> Professor
>>
>> Nova Southeastern University
>>
>> Voice 954-262-5395

> tommac@

>>
>>
>>
>> *From:* SPSSX(r) Discussion &lt;

> SPSSX-L@.UGA

> &gt; *On Behalf Of *Dates,
>> Brian
>> *Sent:* Friday, April 13, 2018 11:05 AM
>>
>> *To:*

> SPSSX-L@.UGA

>> *Subject:* Re: Mann-Whitney U question
>>
>>
>>
>> If you want the actual confidence interval of the median, and not for the
>> p-value, you can use Analyze>Descriptives>Ratio. Using Bruce's data
>> compute
>> a third variable, e.g., denom, to use as the denominator for the ratio
>> test. Use compute denom=1 . Then either run the analysis from the GUI or
>> the syntax below.
>>
>>
>>
>> RATIO STATISTICS Score WITH denom BY Farm (ASCENDING)
>>   /MISSING=EXCLUDE
>>   /PRINT=CIN(95) COD MDCOV MEAN MEDIAN PRD.
>>
>>
>>
>> You'll get medians and confidence intervals for both groups and for the
>> overall score. Because it's based on ranks, you'll need to round to the
>> closest rank to get the 95% CI, or in the case of medians the approximate
>> 95% CI.
>>
>>
>>
>> Brian
>> ------------------------------
>>
>> *From:* SPSSX(r) Discussion &lt;

> SPSSX-L@.UGA

> &gt; on behalf of Bruce
>> Weaver &lt;

> bruce.weaver@

> &gt;
>> *Sent:* Friday, April 13, 2018 10:13:14 AM
>> *To:*

> SPSSX-L@.UGA

>> *Subject:* Re: Mann-Whitney U question
>>
>>
>>
>> I've pasted code for an example below.  What Jon has suggested gives a CI
>> for
>> the p-value.  Is that what you were asking for Stephen?
>>
>>
>> * Example from
>> https://www.statsdirect.co.uk/help/nonparametric_methods/mann_whitney.htm
>> &lt;https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.statsdirect.co.uk%2Fhelp%2Fnonparametric_methods%2Fmann_whitney.htm&amp;data=02%7C01%7Ctommac%40NOVA.EDU%7Cc2704a58bc8a4182f21308d5a14ffeb4%7C2c2b2d312e3e4df1b571fb37c042ff1b%7C0%7C1%7C636592287329755772&amp;sdata=m4pkwBagQXjiTkGN5YbRRSCh3vNAeHMhGzvYF6QJEaA%3D&amp;reserved=0&gt;
>> .
>> NEW FILE.
>> DATASET CLOSE ALL.
>> DATA LIST LIST / Farm(F1) Score(F5.1).
>> BEGIN DATA
>> 1 14.8
>> 1 7.3
>> 1 5.6
>> 1 6.3
>> 1 9.0
>> 1 4.2
>> 1 10.6
>> 1 12.5
>> 1 12.9
>> 1 16.1
>> 1 11.4
>> 1 2.7
>> 0 12.7
>> 0 14.2
>> 0 12.6
>> 0 2.1
>> 0 17.7
>> 0 11.8
>> 0 16.9
>> 0 7.9
>> 0 16.0
>> 0 10.6
>> 0 5.6
>> 0 5.6
>> 0 7.6
>> 0 11.3
>> 0 8.3
>> 0 6.7
>> 0 3.6
>> 0 1.0
>> 0 2.4
>> 0 6.4
>> 0 9.1
>> 0 6.7
>> 0 18.6
>> 0 3.2
>> 0 6.2
>> 0 6.1
>> 0 15.3
>> 0 10.6
>> 0 1.8
>> 0 5.9
>> 0 9.9
>> 0 10.6
>> 0 14.8
>> 0 5.0
>> 0 2.6
>> 0 4.0
>> END DATA.
>>
>> NPAR TESTS
>>   /M-W= Score BY Farm(0 1)
>>   /METHOD= MC CIN(95) SAMPLES(10000).
>>
>> From the output table:
>>
>> Mann-Whitney U:  189.000
>> Wilcoxon W:  855.000
>>
>> z = -.643, p = .520
>> Monte Carlo two-tailed p = .513, 95% CI .503 to .523
>> Monte Carlo one-tailed p = .253, 95% CI .245 to .262
>>
>>
>>
>> Jon Peck wrote
>> > If you have the Exact Tests option, you can use the legacy procedure to
>> > get
>> > a CI for Mann-Whitney with syntax like this, which uses a Monte Carlo
>> > method.  This is supported in the Legacy dialog box.
>> >
>> > NPAR TESTS
>> >   /M-W= educ BY minority(0 1)
>> >   /METHOD= MC CIN(95) SAMPLES(10000).
>> >
>> > Without Exact Tests, you can use the asymptotic standard error and
>> appeal
>> > to asymptotic normality.
>> >
>> >
>> >
>> > On Thu, Apr 12, 2018 at 6:31 PM, Salbod &lt;
>>
>> > ssalbod@
>>
>> > &gt; wrote:
>> >
>> >> Dear Friend,
>> >>
>> >> Is there anyway, using SPSS, to generate Confidence Intervals for the
>> >> Mann-Whitney U test?
>> >>
>> >> Thank you.
>> >>
>> >> Stephen Salbod, Pace University, NYC
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>> &lt;https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fspssx-discussion.1045642.n5.nabble.com%2F&amp;data=02%7C01%7Ctommac%40NOVA.EDU%7Cc2704a58bc8a4182f21308d5a14ffeb4%7C2c2b2d312e3e4df1b571fb37c042ff1b%7C0%7C1%7C636592287329755772&amp;sdata=x4oI%2B%2BOnsFDbdnWKyU2RuPVzvH9GrH6SVCU9fW7uxZ4%3D&amp;reserved=0&gt;
>> >>
>> >> =====================
>> >> To manage your subscription to SPSSX-L, send a message to
>> >>
>>
>> > LISTSERV@.UGA
>>
>> >  (not to SPSSX-L), with no body text except the
>> >> command. To leave the list, send the command
>> >> SIGNOFF SPSSX-L
>> >> For a list of commands to manage subscriptions, send the command
>> >> INFO REFCARD
>> >>
>> >
>> >
>> >
>> > --
>> > Jon K Peck
>>
>> > jkpeck@
>>
>> >
>> > =====================
>> > To manage your subscription to SPSSX-L, send a message to
>>
>> > LISTSERV@.UGA
>>
>> >  (not to SPSSX-L), with no body text except the
>> > command. To leave the list, send the command
>> > SIGNOFF SPSSX-L
>> > For a list of commands to manage subscriptions, send the command
>> > INFO REFCARD
>>
>>
>>
>>
>>
>> -----
>> --
>> Bruce Weaver
>>

> bweaver@

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
>> command. To leave the list, send the command
>> SIGNOFF SPSSX-L
>> For a list of commands to manage subscriptions, send the command
>> INFO REFCARD
>>
>> ===================== To manage your subscription to SPSSX-L, send a
>> message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text
>> except the command. To leave the list, send the command SIGNOFF SPSSX-L
>> For
>> a list of commands to manage subscriptions, send the command INFO REFCARD
>> ===================== To manage your subscription to SPSSX-L, send a
>> message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text
>> except the command. To leave the list, send the command SIGNOFF SPSSX-L
>> For
>> a list of commands to manage subscriptions, send the command INFO REFCARD
>>
>
>
>
> --
> Jon K Peck

> jkpeck@

>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
Reply | Threaded
Open this post in threaded view
|

Re: Mann-Whitney U question

Salbod
Hi Bruce, now I'm thinking about it. Thank you for the link. -Steve

-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Bruce Weaver
Sent: Friday, April 13, 2018 6:09 PM
To: [hidden email]
Subject: Re: Mann-Whitney U question

I wondered if Stephen was thinking about a CI for the parameter that Ronán Conroy describes in his Stata Journal article on the Mann-Whitney U test--i.e., the probability that a randomly drawn X is greater than a randomly drawn Y.  Stata's -ranksum- command has an option (porder) to estimate that parameter, but does not report a CI for it.  I am not aware of any direct & easy way to compute that parameter or a CI for it using SPSS.  

https://www.stata-journal.com/sjpdf.html?articlenum=st0253



Jon Peck wrote

> Probably, the ci I pointed out is not what  you want as it pertains to
> the Monte Carlo distribution.  If you use the R  approach, here is a
> gentler way to do this in Statistics.
>
> First, install the coin package (one time).  This will prompt you for
> a location.  Choose some US location from the list that appears.
>
> begin program r.
> install.packages("coin")
> end program.
>
> To run the test and get a ci for the shift in the distributions, first
> make sure that the group variable measurement level is set to nominal
> or ordinal.  Then run this code (using Bruce's data).
>
> begin program r.
> library(coin)
> data= spssdata.GetDataFromSPSS(factorMode="levels")
> wilcox_test(Score~Farm, data=data, conf.int=TRUE,
> distribution="exact") end program.
>
>
> On Fri, Apr 13, 2018 at 9:21 AM, Thomas MacFarland &lt;

> tommac@

> &gt; wrote:
>
>> Greetings:
>>
>>
>>
>> You can also use R to easily obtain the desired statistics:
>>
>>
>>
>> *install.packages**("coin")*
>>
>> *library(coin)                  # Load the coin package.*
>>
>> *help(package=coin)             # Show the information page.*
>>
>> *sessionInfo**()                  # Confirm all attached packages.*
>>
>> *# Select the most local mirror site using Set CRAN mirror.*
>>
>>
>>
>> *coin::wilcox_test(Judgment ~ Treatment.recode,*
>>
>> *  data = Goats.df,*
>>
>> *  distribution = "exact", conf.int &lt;http://conf.int&gt; = TRUE)*
>>
>> *  # Note the use of ~ between the two object variables*
>>
>>
>>
>> Look at https://www.springer.com/us/book/9783319306339 and more
>> specifically the chapter on Mann-Whitney for more detail if the above
>> syntax is not sufficient.
>>
>>
>>
>> BTW, the Goats.df dataset is available as a free download.  Just
>> click on *ESM files
>> &lt;http://www.springer.com/cda/content/document/cda_downloaddocument
>> /MacFarland.zip?SGWID=0-0-45-1578079-p179875955&gt;*
>> and
>> then select Chapter 4 when the file(s) open.
>>
>>
>>
>> Best wishes.
>>
>>
>>
>> Tom MacFarland
>>
>> ----------
>>
>> Thomas W. MacFarland, Ed.D.
>>
>> Senior Research Associate; Institutional Effectiveness and Associate
>> Professor
>>
>> Nova Southeastern University
>>
>> Voice 954-262-5395

> tommac@

>>
>>
>>
>> *From:* SPSSX(r) Discussion &lt;

> SPSSX-L@.UGA

> &gt; *On Behalf Of *Dates,
>> Brian
>> *Sent:* Friday, April 13, 2018 11:05 AM
>>
>> *To:*

> SPSSX-L@.UGA

>> *Subject:* Re: Mann-Whitney U question
>>
>>
>>
>> If you want the actual confidence interval of the median, and not for
>> the p-value, you can use Analyze>Descriptives>Ratio. Using Bruce's
>> data compute a third variable, e.g., denom, to use as the denominator
>> for the ratio test. Use compute denom=1 . Then either run the
>> analysis from the GUI or the syntax below.
>>
>>
>>
>> RATIO STATISTICS Score WITH denom BY Farm (ASCENDING)
>>   /MISSING=EXCLUDE
>>   /PRINT=CIN(95) COD MDCOV MEAN MEDIAN PRD.
>>
>>
>>
>> You'll get medians and confidence intervals for both groups and for
>> the overall score. Because it's based on ranks, you'll need to round
>> to the closest rank to get the 95% CI, or in the case of medians the
>> approximate 95% CI.
>>
>>
>>
>> Brian
>> ------------------------------
>>
>> *From:* SPSSX(r) Discussion &lt;

> SPSSX-L@.UGA

> &gt; on behalf of Bruce
>> Weaver &lt;

> bruce.weaver@

> &gt;
>> *Sent:* Friday, April 13, 2018 10:13:14 AM
>> *To:*

> SPSSX-L@.UGA

>> *Subject:* Re: Mann-Whitney U question
>>
>>
>>
>> I've pasted code for an example below.  What Jon has suggested gives
>> a CI for the p-value.  Is that what you were asking for Stephen?
>>
>>
>> * Example from
>> https://www.statsdirect.co.uk/help/nonparametric_methods/mann_whitney
>> .htm
>> &lt;https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2F
>> www.statsdirect.co.uk%2Fhelp%2Fnonparametric_methods%2Fmann_whitney.h
>> tm&amp;data=02%7C01%7Ctommac%40NOVA.EDU%7Cc2704a58bc8a4182f21308d5a14
>> ffeb4%7C2c2b2d312e3e4df1b571fb37c042ff1b%7C0%7C1%7C636592287329755772
>> &amp;sdata=m4pkwBagQXjiTkGN5YbRRSCh3vNAeHMhGzvYF6QJEaA%3D&amp;reserve
>> d=0&gt;
>> .
>> NEW FILE.
>> DATASET CLOSE ALL.
>> DATA LIST LIST / Farm(F1) Score(F5.1).
>> BEGIN DATA
>> 1 14.8
>> 1 7.3
>> 1 5.6
>> 1 6.3
>> 1 9.0
>> 1 4.2
>> 1 10.6
>> 1 12.5
>> 1 12.9
>> 1 16.1
>> 1 11.4
>> 1 2.7
>> 0 12.7
>> 0 14.2
>> 0 12.6
>> 0 2.1
>> 0 17.7
>> 0 11.8
>> 0 16.9
>> 0 7.9
>> 0 16.0
>> 0 10.6
>> 0 5.6
>> 0 5.6
>> 0 7.6
>> 0 11.3
>> 0 8.3
>> 0 6.7
>> 0 3.6
>> 0 1.0
>> 0 2.4
>> 0 6.4
>> 0 9.1
>> 0 6.7
>> 0 18.6
>> 0 3.2
>> 0 6.2
>> 0 6.1
>> 0 15.3
>> 0 10.6
>> 0 1.8
>> 0 5.9
>> 0 9.9
>> 0 10.6
>> 0 14.8
>> 0 5.0
>> 0 2.6
>> 0 4.0
>> END DATA.
>>
>> NPAR TESTS
>>   /M-W= Score BY Farm(0 1)
>>   /METHOD= MC CIN(95) SAMPLES(10000).
>>
>> From the output table:
>>
>> Mann-Whitney U:  189.000
>> Wilcoxon W:  855.000
>>
>> z = -.643, p = .520
>> Monte Carlo two-tailed p = .513, 95% CI .503 to .523 Monte Carlo
>> one-tailed p = .253, 95% CI .245 to .262
>>
>>
>>
>> Jon Peck wrote
>> > If you have the Exact Tests option, you can use the legacy
>> > procedure to get a CI for Mann-Whitney with syntax like this, which
>> > uses a Monte Carlo method.  This is supported in the Legacy dialog
>> > box.
>> >
>> > NPAR TESTS
>> >   /M-W= educ BY minority(0 1)
>> >   /METHOD= MC CIN(95) SAMPLES(10000).
>> >
>> > Without Exact Tests, you can use the asymptotic standard error and
>> appeal
>> > to asymptotic normality.
>> >
>> >
>> >
>> > On Thu, Apr 12, 2018 at 6:31 PM, Salbod &lt;
>>
>> > ssalbod@
>>
>> > &gt; wrote:
>> >
>> >> Dear Friend,
>> >>
>> >> Is there anyway, using SPSS, to generate Confidence Intervals for
>> >> the Mann-Whitney U test?
>> >>
>> >> Thank you.
>> >>
>> >> Stephen Salbod, Pace University, NYC
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>> &lt;https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fs
>> pssx-discussion.1045642.n5.nabble.com%2F&amp;data=02%7C01%7Ctommac%40
>> NOVA.EDU%7Cc2704a58bc8a4182f21308d5a14ffeb4%7C2c2b2d312e3e4df1b571fb3
>> 7c042ff1b%7C0%7C1%7C636592287329755772&amp;sdata=x4oI%2B%2BOnsFDbdnWK
>> yU2RuPVzvH9GrH6SVCU9fW7uxZ4%3D&amp;reserved=0&gt;
>> >>
>> >> =====================
>> >> To manage your subscription to SPSSX-L, send a message to
>> >>
>>
>> > LISTSERV@.UGA
>>
>> >  (not to SPSSX-L), with no body text except the
>> >> command. To leave the list, send the command SIGNOFF SPSSX-L For a
>> >> list of commands to manage subscriptions, send the command INFO
>> >> REFCARD
>> >>
>> >
>> >
>> >
>> > --
>> > Jon K Peck
>>
>> > jkpeck@
>>
>> >
>> > =====================
>> > To manage your subscription to SPSSX-L, send a message to
>>
>> > LISTSERV@.UGA
>>
>> >  (not to SPSSX-L), with no body text except the command. To leave
>> > the list, send the command SIGNOFF SPSSX-L For a list of commands
>> > to manage subscriptions, send the command INFO REFCARD
>>
>>
>>
>>
>>
>> -----
>> --
>> Bruce Weaver
>>

> bweaver@

>> http://sites.google.com/a/lakeheadu.ca/bweaver/
>> &lt;https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fs
>> ites.google.com%2Fa%2Flakeheadu.ca%2Fbweaver%2F&amp;data=02%7C01%7Cto
>> mmac%40NOVA.EDU%7Cc2704a58bc8a4182f21308d5a14ffeb4%7C2c2b2d312e3e4df1
>> b571fb37c042ff1b%7C0%7C1%7C636592287329755772&amp;sdata=bfW6tCkl4S5o8
>> dr96R4wQtwrqidvpvC9d%2BFkqsahagQ%3D&amp;reserved=0&gt;
>>
>> "When all else fails, RTFM."
>>
>> NOTE: My Hotmail account is not monitored regularly.
>> To send me an e-mail, please use the address shown above.
>>
>> --
>> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>> &lt;https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fs
>> pssx-discussion.1045642.n5.nabble.com%2F&amp;data=02%7C01%7Ctommac%40
>> NOVA.EDU%7Cc2704a58bc8a4182f21308d5a14ffeb4%7C2c2b2d312e3e4df1b571fb3
>> 7c042ff1b%7C0%7C1%7C636592287329755772&amp;sdata=x4oI%2B%2BOnsFDbdnWK
>> yU2RuPVzvH9GrH6SVCU9fW7uxZ4%3D&amp;reserved=0&gt;
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
>> command. To leave the list, send the command SIGNOFF SPSSX-L For a
>> list of commands to manage subscriptions, send the command INFO
>> REFCARD
>>
>> ===================== To manage your subscription to SPSSX-L, send a
>> message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text
>> except the command. To leave the list, send the command SIGNOFF
>> SPSSX-L For a list of commands to manage subscriptions, send the
>> command INFO REFCARD ===================== To manage your
>> subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text
>> except the command. To leave the list, send the command SIGNOFF
>> SPSSX-L For a list of commands to manage subscriptions, send the
>> command INFO REFCARD
>>
>
>
>
> --
> Jon K Peck

> jkpeck@

>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the command. To leave the
> list, send the command SIGNOFF SPSSX-L For a list of commands to
> manage subscriptions, send the command INFO REFCARD





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Mann-Whitney U question

Jon Peck
In reply to this post by Bruce Weaver
As this article brings up quantile regression as an alternative or extension for particular hypotheses, I should point out that quantile regression is available in Statistics via the SPSSINC QUANTREG extension command.

On Fri, Apr 13, 2018 at 4:10 PM Bruce Weaver <[hidden email]> wrote:
I wondered if Stephen was thinking about a CI for the parameter that Ronán
Conroy describes in his Stata Journal article on the Mann-Whitney U
test--i.e., the probability that a randomly drawn X is greater than a
randomly drawn Y.  Stata's -ranksum- command has an option (porder) to
estimate that parameter, but does not report a CI for it.  I am not aware of
any direct & easy way to compute that parameter or a CI for it using SPSS. 

https://www.stata-journal.com/sjpdf.html?articlenum=st0253



Jon Peck wrote
> Probably, the ci I pointed out is not what  you want as it pertains to the
> Monte Carlo distribution.  If you use the R  approach, here is a gentler
> way to do this in Statistics.
>
> First, install the coin package (one time).  This will prompt you for a
> location.  Choose some US location from the list that appears.
>
> begin program r.
> install.packages("coin")
> end program.
>
> To run the test and get a ci for the shift in the distributions, first
> make
> sure that the group variable measurement level is set to nominal or
> ordinal.  Then run this code (using Bruce's data).
>
> begin program r.
> library(coin)
> data= spssdata.GetDataFromSPSS(factorMode="levels")
> wilcox_test(Score~Farm, data=data, conf.int=TRUE, distribution="exact")
> end program.
>
>
> On Fri, Apr 13, 2018 at 9:21 AM, Thomas MacFarland &lt;

> tommac@

> &gt; wrote:
>
>> Greetings:
>>
>>
>>
>> You can also use R to easily obtain the desired statistics:
>>
>>
>>
>> *install.packages**("coin")*
>>
>> *library(coin)                  # Load the coin package.*
>>
>> *help(package=coin)             # Show the information page.*
>>
>> *sessionInfo**()                  # Confirm all attached packages.*
>>
>> *# Select the most local mirror site using Set CRAN mirror.*
>>
>>
>>
>> *coin::wilcox_test(Judgment ~ Treatment.recode,*
>>
>> *  data = Goats.df,*
>>
>> *  distribution = "exact", conf.int &lt;http://conf.int&gt; = TRUE)*
>>
>> *  # Note the use of ~ between the two object variables*
>>
>>
>>
>> Look at https://www.springer.com/us/book/9783319306339 and more
>> specifically the chapter on Mann-Whitney for more detail if the above
>> syntax is not sufficient.
>>
>>
>>
>> BTW, the Goats.df dataset is available as a free download.  Just click on
>> *ESM
>> files
>> &lt;http://www.springer.com/cda/content/document/cda_downloaddocument/MacFarland.zip?SGWID=0-0-45-1578079-p179875955&gt;*
>> and
>> then select Chapter 4 when the file(s) open.
>>
>>
>>
>> Best wishes.
>>
>>
>>
>> Tom MacFarland
>>
>> ----------
>>
>> Thomas W. MacFarland, Ed.D.
>>
>> Senior Research Associate; Institutional Effectiveness and Associate
>> Professor
>>
>> Nova Southeastern University
>>
>> Voice 954-262-5395

> tommac@

>>
>>
>>
>> *From:* SPSSX(r) Discussion &lt;

> SPSSX-L@.UGA

> &gt; *On Behalf Of *Dates,
>> Brian
>> *Sent:* Friday, April 13, 2018 11:05 AM
>>
>> *To:*

> SPSSX-L@.UGA

>> *Subject:* Re: Mann-Whitney U question
>>
>>
>>
>> If you want the actual confidence interval of the median, and not for the
>> p-value, you can use Analyze>Descriptives>Ratio. Using Bruce's data
>> compute
>> a third variable, e.g., denom, to use as the denominator for the ratio
>> test. Use compute denom=1 . Then either run the analysis from the GUI or
>> the syntax below.
>>
>>
>>
>> RATIO STATISTICS Score WITH denom BY Farm (ASCENDING)
>>   /MISSING=EXCLUDE
>>   /PRINT=CIN(95) COD MDCOV MEAN MEDIAN PRD.
>>
>>
>>
>> You'll get medians and confidence intervals for both groups and for the
>> overall score. Because it's based on ranks, you'll need to round to the
>> closest rank to get the 95% CI, or in the case of medians the approximate
>> 95% CI.
>>
>>
>>
>> Brian
>> ------------------------------
>>
>> *From:* SPSSX(r) Discussion &lt;

> SPSSX-L@.UGA

> &gt; on behalf of Bruce
>> Weaver &lt;

> bruce.weaver@

> &gt;
>> *Sent:* Friday, April 13, 2018 10:13:14 AM
>> *To:*

> SPSSX-L@.UGA

>> *Subject:* Re: Mann-Whitney U question
>>
>>
>>
>> I've pasted code for an example below.  What Jon has suggested gives a CI
>> for
>> the p-value.  Is that what you were asking for Stephen?
>>
>>
>> * Example from
>> https://www.statsdirect.co.uk/help/nonparametric_methods/mann_whitney.htm
>> &lt;https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.statsdirect.co.uk%2Fhelp%2Fnonparametric_methods%2Fmann_whitney.htm&amp;data=02%7C01%7Ctommac%40NOVA.EDU%7Cc2704a58bc8a4182f21308d5a14ffeb4%7C2c2b2d312e3e4df1b571fb37c042ff1b%7C0%7C1%7C636592287329755772&amp;sdata=m4pkwBagQXjiTkGN5YbRRSCh3vNAeHMhGzvYF6QJEaA%3D&amp;reserved=0&gt;
>> .
>> NEW FILE.
>> DATASET CLOSE ALL.
>> DATA LIST LIST / Farm(F1) Score(F5.1).
>> BEGIN DATA
>> 1 14.8
>> 1 7.3
>> 1 5.6
>> 1 6.3
>> 1 9.0
>> 1 4.2
>> 1 10.6
>> 1 12.5
>> 1 12.9
>> 1 16.1
>> 1 11.4
>> 1 2.7
>> 0 12.7
>> 0 14.2
>> 0 12.6
>> 0 2.1
>> 0 17.7
>> 0 11.8
>> 0 16.9
>> 0 7.9
>> 0 16.0
>> 0 10.6
>> 0 5.6
>> 0 5.6
>> 0 7.6
>> 0 11.3
>> 0 8.3
>> 0 6.7
>> 0 3.6
>> 0 1.0
>> 0 2.4
>> 0 6.4
>> 0 9.1
>> 0 6.7
>> 0 18.6
>> 0 3.2
>> 0 6.2
>> 0 6.1
>> 0 15.3
>> 0 10.6
>> 0 1.8
>> 0 5.9
>> 0 9.9
>> 0 10.6
>> 0 14.8
>> 0 5.0
>> 0 2.6
>> 0 4.0
>> END DATA.
>>
>> NPAR TESTS
>>   /M-W= Score BY Farm(0 1)
>>   /METHOD= MC CIN(95) SAMPLES(10000).
>>
>> From the output table:
>>
>> Mann-Whitney U:  189.000
>> Wilcoxon W:  855.000
>>
>> z = -.643, p = .520
>> Monte Carlo two-tailed p = .513, 95% CI .503 to .523
>> Monte Carlo one-tailed p = .253, 95% CI .245 to .262
>>
>>
>>
>> Jon Peck wrote
>> > If you have the Exact Tests option, you can use the legacy procedure to
>> > get
>> > a CI for Mann-Whitney with syntax like this, which uses a Monte Carlo
>> > method.  This is supported in the Legacy dialog box.
>> >
>> > NPAR TESTS
>> >   /M-W= educ BY minority(0 1)
>> >   /METHOD= MC CIN(95) SAMPLES(10000).
>> >
>> > Without Exact Tests, you can use the asymptotic standard error and
>> appeal
>> > to asymptotic normality.
>> >
>> >
>> >
>> > On Thu, Apr 12, 2018 at 6:31 PM, Salbod &lt;
>>
>> > ssalbod@
>>
>> > &gt; wrote:
>> >
>> >> Dear Friend,
>> >>
>> >> Is there anyway, using SPSS, to generate Confidence Intervals for the
>> >> Mann-Whitney U test?
>> >>
>> >> Thank you.
>> >>
>> >> Stephen Salbod, Pace University, NYC
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>> &lt;https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fspssx-discussion.1045642.n5.nabble.com%2F&amp;data=02%7C01%7Ctommac%40NOVA.EDU%7Cc2704a58bc8a4182f21308d5a14ffeb4%7C2c2b2d312e3e4df1b571fb37c042ff1b%7C0%7C1%7C636592287329755772&amp;sdata=x4oI%2B%2BOnsFDbdnWKyU2RuPVzvH9GrH6SVCU9fW7uxZ4%3D&amp;reserved=0&gt;
>> >>
>> >> =====================
>> >> To manage your subscription to SPSSX-L, send a message to
>> >>
>>
>> > LISTSERV@.UGA
>>
>> >  (not to SPSSX-L), with no body text except the
>> >> command. To leave the list, send the command
>> >> SIGNOFF SPSSX-L
>> >> For a list of commands to manage subscriptions, send the command
>> >> INFO REFCARD
>> >>
>> >
>> >
>> >
>> > --
>> > Jon K Peck
>>
>> > jkpeck@
>>
>> >
>> > =====================
>> > To manage your subscription to SPSSX-L, send a message to
>>
>> > LISTSERV@.UGA
>>
>> >  (not to SPSSX-L), with no body text except the
>> > command. To leave the list, send the command
>> > SIGNOFF SPSSX-L
>> > For a list of commands to manage subscriptions, send the command
>> > INFO REFCARD
>>
>>
>>
>>
>>
>> -----
>> --
>> Bruce Weaver
>>

> bweaver@

>> http://sites.google.com/a/lakeheadu.ca/bweaver/
>> &lt;https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsites.google.com%2Fa%2Flakeheadu.ca%2Fbweaver%2F&amp;data=02%7C01%7Ctommac%40NOVA.EDU%7Cc2704a58bc8a4182f21308d5a14ffeb4%7C2c2b2d312e3e4df1b571fb37c042ff1b%7C0%7C1%7C636592287329755772&amp;sdata=bfW6tCkl4S5o8dr96R4wQtwrqidvpvC9d%2BFkqsahagQ%3D&amp;reserved=0&gt;
>>
>> "When all else fails, RTFM."
>>
>> NOTE: My Hotmail account is not monitored regularly.
>> To send me an e-mail, please use the address shown above.
>>
>> --
>> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>> &lt;https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fspssx-discussion.1045642.n5.nabble.com%2F&amp;data=02%7C01%7Ctommac%40NOVA.EDU%7Cc2704a58bc8a4182f21308d5a14ffeb4%7C2c2b2d312e3e4df1b571fb37c042ff1b%7C0%7C1%7C636592287329755772&amp;sdata=x4oI%2B%2BOnsFDbdnWKyU2RuPVzvH9GrH6SVCU9fW7uxZ4%3D&amp;reserved=0&gt;
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
>> command. To leave the list, send the command
>> SIGNOFF SPSSX-L
>> For a list of commands to manage subscriptions, send the command
>> INFO REFCARD
>>
>> ===================== To manage your subscription to SPSSX-L, send a
>> message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text
>> except the command. To leave the list, send the command SIGNOFF SPSSX-L
>> For
>> a list of commands to manage subscriptions, send the command INFO REFCARD
>> ===================== To manage your subscription to SPSSX-L, send a
>> message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text
>> except the command. To leave the list, send the command SIGNOFF SPSSX-L
>> For
>> a list of commands to manage subscriptions, send the command INFO REFCARD
>>
>
>
>
> --
> Jon K Peck

> jkpeck@

>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD