ski.mack test in R

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

ski.mack test in R

Sophie Bleke
Dear R-Help List,

For part of my data, which I analyse with Friedman.test, there is data
missing, which is a normal result of the experimental setup. If I am
correct, I need to use the Ski.Mack test in R for it.

Normally, I read my data in for Friedman or post hoc Wilcoxon like below:

a <- read.table(file.choose(), header=T)

attach(a)
a<-as.matrix(a)

friedman.test(a)

I tried to replace the friedman line with your ski.mack command, but it is
not getting me where I need to get.

Ski.Mack(a, simulate.p.value = TRUE, B = 1000)

or

Ski.Mack(a)

Both don't work.

Is there as simple command way, as above, to read out the ski.mack test
from my txt file, without manually typing all the data points as rows and
colums in the R console, which is recommended in the ski.mack author's
online PDF? It's a lot of data and manually inputting rows and colums and
data points won't be doable in this case.

I would be very grateful to hear of an elegant short solution, similar to
the friedman command / read-in lines above.

Sophie

        [[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: ski.mack test in R

Sarah Goslee
Hi Sophie,

We don't have enough information to help you.

You DON'T need to type in the data for your test - that's how the
package authors are creating a reproducible example for you.

But you do need to have your data in the correct format, and we have
no idea what your a looks like.


a <- read.table(file.choose(), header=T) # good
# attach(a) # don't do this
a<-as.matrix(a)

library(Skillings.Mack) # you forgot to tell us where you got the
function you're using

a needs to be "Either a numeric vector of data values, or a data
matrix. If a matrix is used, columns and rows are correspondent to
blocks and treatments (groups), respectively."

Since your a is a matrix, then it should be the latter. Is that what you have?

You say that

Ski.Mack(a)

"doesn't work." That isn't enough for us to help. What error message
do you get? We need specifics about what "doesn't work" means.

We also need a reproducible example, possibly with toy data like the
package authors used
[.https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example]
The output of

str(a)

would also be very helpful.

Sarah

On Tue, Aug 20, 2019 at 12:02 PM Sophie Bleke <[hidden email]> wrote:

>
> Dear R-Help List,
>
> For part of my data, which I analyse with Friedman.test, there is data
> missing, which is a normal result of the experimental setup. If I am
> correct, I need to use the Ski.Mack test in R for it.
>
> Normally, I read my data in for Friedman or post hoc Wilcoxon like below:
>
> a <- read.table(file.choose(), header=T)
>
> attach(a)
> a<-as.matrix(a)
>
> friedman.test(a)
>
> I tried to replace the friedman line with your ski.mack command, but it is
> not getting me where I need to get.
>
> Ski.Mack(a, simulate.p.value = TRUE, B = 1000)
>
> or
>
> Ski.Mack(a)
>
> Both don't work.
>
> Is there as simple command way, as above, to read out the ski.mack test
> from my txt file, without manually typing all the data points as rows and
> colums in the R console, which is recommended in the ski.mack author's
> online PDF? It's a lot of data and manually inputting rows and colums and
> data points won't be doable in this case.
>
> I would be very grateful to hear of an elegant short solution, similar to
> the friedman command / read-in lines above.
>
> Sophie
>


--
Sarah Goslee (she/her)
http://www.numberwright.com

______________________________________________
[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: ski.mack test in R

Sarah Goslee
Hi Sophie,

It's good form to reply to the list, not directly to me - I'm not able
to help people individually. It's also good form to put the necessary
info directly into your email, rather than expecting people to open
attachments (which the mailing list might not even allow, depending on
format).

However, your problem is very simple:

You need to load a package before using functions from it.

Ski.Mack() is not found because you first need to do

library(Skillings.Mack)

to make it available to your R session.

(Assuming you've installed the package; if not

install.packages("Skillings.Mack")

will do that for you.

I strongly, strongly suggest that you read one of the good
introductions to R out there, possibly even the one that comes with R,
and is also available here:

https://cran.r-project.org/doc/manuals/r-release/R-intro.pdf

That you've had this problem shows that you don't understand the very
basics of how to use R, so you should familiarize yourself with it
first.

Best,
Sarah

On Fri, Aug 23, 2019 at 6:24 AM Sophie Bleke <[hidden email]> wrote:

>
> Dear Sarah,
>
> Thank you for you kind and quick response.
>
> I attach the PDF in which I found the ski.mack instructions. This file is available online.
> I also attach some toy data, on which I am trying to perform the ski.mack test.
> Please also find attached a txt. file in which you can find the output of str(a) and error message of ski.mack(a) etc.
>
> I would be very grateful to hear back from you or the list.
>
> With all my best,
> Sophie
>
> Am Di., 20. Aug. 2019 um 19:18 Uhr schrieb Sarah Goslee <[hidden email]>:
>>
>> Hi Sophie,
>>
>> We don't have enough information to help you.
>>
>> You DON'T need to type in the data for your test - that's how the
>> package authors are creating a reproducible example for you.
>>
>> But you do need to have your data in the correct format, and we have
>> no idea what your a looks like.
>>
>>
>> a <- read.table(file.choose(), header=T) # good
>> # attach(a) # don't do this
>> a<-as.matrix(a)
>>
>> library(Skillings.Mack) # you forgot to tell us where you got the
>> function you're using
>>
>> a needs to be "Either a numeric vector of data values, or a data
>> matrix. If a matrix is used, columns and rows are correspondent to
>> blocks and treatments (groups), respectively."
>>
>> Since your a is a matrix, then it should be the latter. Is that what you have?
>>
>> You say that
>>
>> Ski.Mack(a)
>>
>> "doesn't work." That isn't enough for us to help. What error message
>> do you get? We need specifics about what "doesn't work" means.
>>
>> We also need a reproducible example, possibly with toy data like the
>> package authors used
>> [.https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example]
>> The output of
>>
>> str(a)
>>
>> would also be very helpful.
>>
>> Sarah
>>
>> On Tue, Aug 20, 2019 at 12:02 PM Sophie Bleke <[hidden email]> wrote:
>> >
>> > Dear R-Help List,
>> >
>> > For part of my data, which I analyse with Friedman.test, there is data
>> > missing, which is a normal result of the experimental setup. If I am
>> > correct, I need to use the Ski.Mack test in R for it.
>> >
>> > Normally, I read my data in for Friedman or post hoc Wilcoxon like below:
>> >
>> > a <- read.table(file.choose(), header=T)
>> >
>> > attach(a)
>> > a<-as.matrix(a)
>> >
>> > friedman.test(a)
>> >
>> > I tried to replace the friedman line with your ski.mack command, but it is
>> > not getting me where I need to get.
>> >
>> > Ski.Mack(a, simulate.p.value = TRUE, B = 1000)
>> >
>> > or
>> >
>> > Ski.Mack(a)
>> >
>> > Both don't work.
>> >
>> > Is there as simple command way, as above, to read out the ski.mack test
>> > from my txt file, without manually typing all the data points as rows and
>> > colums in the R console, which is recommended in the ski.mack author's
>> > online PDF? It's a lot of data and manually inputting rows and colums and
>> > data points won't be doable in this case.
>> >
>> > I would be very grateful to hear of an elegant short solution, similar to
>> > the friedman command / read-in lines above.
>> >
>> > Sophie
>> >
>>
>>
>> --
>> Sarah Goslee (she/her)
>> http://www.numberwright.com

______________________________________________
[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.