Stats Package Fix

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

Stats Package Fix

Jay Waldron
 Good afternoon,

Using this file, with the tab for Growth_Value (I have pasted some code
below), if I add the argument *exact = F *it produces the Wilcoxon signed
rank test with continuity correction. The description documentation leads
me to believe that's the wrong argument (should be the "correct" not the
"exact" argument. I am using R Studio Version 1.2.1335 running R 3.6.1

This was posed in our Business Statistics Class, taught at Utah Valley
University, of which I am a senior undergraduate.

A response by tomorrow would be ideal, but I would still like an answer
even if that timeline is too aggressive. Thank you for your consideration.
My contact information is:

Jay Spencer Waldron
Personal Email (This is the one I am subscribed to R-Help with):
[hidden email]
(385) 335-7879

#---Code paste begins---
> library(readxl)
> Growth_Value <- read_excel("2019
SUMMER/ECON-3340-003/Ch20/Chapter20.xlsx",
+     sheet = "Growth_Value")
> View(Growth_Value)
> wilcox.test(Growth_Value$'Growth', mu=5, alternative="greater")

Wilcoxon signed rank test

data:  Growth_Value$Growth
V = 40, p-value = 0.1162
alternative hypothesis: true location is greater than 5

>
>
> wilcox.test(Growth_Value$'Growth', Growth_Value$'Value',
alternative="two.sided", paired=TRUE)

Wilcoxon signed rank test

data:  Growth_Value$Growth and Growth_Value$Value
V = 40, p-value = 0.2324
alternative hypothesis: true location shift is not equal to 0

> wilcox.test(Growth_Value$'Growth', mu=5, alternative="greater", exact=F)

Wilcoxon signed rank test with continuity correction

data:  Growth_Value$Growth
V = 40, p-value = 0.1106
alternative hypothesis: true location is greater than 5


#---Code Paste Ends---

*Documentation referenced*




*exact a logical indicating whether an exact p-value should be
computed.correct a logical indicating whether to apply continuity
correction in the normal approximation for the p-value.*


Thanks you for your time,

Jay
Educational Email:
[hidden email]

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Stats Package Fix

Abby Spurdle
(excerpts only)
> Using this file, with the tab for Growth_Value (I have pasted some code
> below), if I add the argument *exact = F *it produces the Wilcoxon signed
> rank test with continuity correction. The description documentation leads
> me to believe that's the wrong argument (should be the "correct" not the
> "exact" argument.
> A response by tomorrow would be ideal, but I would still like an answer

I do *not* speak for R Core, and I'm not expert on this test.
However, it appears it's doing what it's supposed to be doing.

There are separate arguments for exact and correct (which defaults to true).
And according to the documentation:

"By default (if exact is not specified), an exact p-value is computed if
the samples contain less than 50 finite values and there are no ties.
Otherwise, a normal approximation is used."

When you set exact to false (FALSE is preferable to F), the normal
approximation is used, with the continuity correction.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.