[R] indexing for Wilcoxon test

Rui Barradas ruipbarradas at sapo.pt
Wed Nov 14 18:34:03 CET 2012


Hello,

Use ?dput to post data, like this it's unreadable. For instance,

dput(Mydata)  # paste the output of this in a post.

Hope this helps,

Rui Barradas
Em 14-11-2012 15:58, Jeffrey Stratford escreveu:
> Hi everyone,
>
> I've been asked to run a number of Wilcoxon tests on some behavioral data
> (below is a sample).  They want me to compare each trial to the first
> trial, considered the control trial. I know I can use brackets to index and
> select, for example, trial 1 vs. trial 4 (not exactly sure how to set that
> up either) but it would save me a ton of time if there was a way to do all
> the comparisons at once - but for one response variable (e.g., removed) at
> a time.
>
> Thanks so much!
>
> Jeff
>
>   id trial sex removed eaten scatter larder total  1 1 1 2.65 2 1.41 1 1.73
> 2 1 1 1.41 1 0 1 1  3 1 1 2.24 1 1.73 1 2  4 1 1 0 0 0 0 0  5 1 1 2.65 2.24
> 0 1.41 1.41  6 1 1 3.87 1 2.83 2.45 3.74  7 1 1 2.24 0 0 2.24 2.24  8 1 1
> 2.65 1.41 2.24 0 2.24  1 2 1 4.36 2.45 3 2 3.61  2 2 1 2.24 2 1 0 1  3 2 1
> 2.45 1.73 1.41 1 1.73  4 2 1 2.45 2 0 1.41 1.41  5 2 1 2.45 2 1.41 0 1.41  6
> 2 1 2.24 1 1.41 1.41 2  7 2 1 2.45 1 1.41 1.73 2.24  8 2 1 2.65 1.73 2 0 2
> 1 3 1 5.48 2.83 0 4.69 4.69  2 3 1 2.65 2 1.73 0 1.73  3 3 1 2.83 2.45 1 1
> 1.41  4 3 1 1.73 1.41 0 1 1  5 3 1 2.45 2.45 0 0 0  6 3 1 2.24 1 1.73 1 2  7
> 3 1 2.45 1.41 0 2 2  8 3 1 3.46 2.65 2.24 0 2.24  1 4 1 1.41 1 0 1 1  2 4 1
> 1.73 1.73 0 0 0  3 4 1 2.45 2.24 0 1 1  4 4 1 1 1 0 0 0  5 4 1 2.83 1.73
> 1.41 1.73 2.24  6 4 1 1.73 1.73 0 0 0  7 4 1 2.83 2.24 0 1.73 1.73  8 4 1 3
> 1.73 2.45 0 2.45  1 5 1 3.74 2.83 2 1.41 2.45  2 5 1 2.24 2 1 0 1  3 5 1
> 2.24 1.73 1.41 0 1.41  4 5 1 1.41 1 1 0 1  5 5 1 2.83 2.24 1.73 0 1.73  6 5
> 1 2.45 1 2 1 2.24  7 5 1 3.16 2 1 2.24 2.45  8 5 1 3.61 2 2.45 1.73 3  1 6 1
> 3.61 2.45 1 2.45 2.65  2 6 1 3.16 2.24 1.73 1.41 2.24  3 6 1 2.65 2.45 1 0 1
> 4 6 1 2.65 1.73 1.41 1.41 2  5 6 1 3.74 2.24 1.41 2.65 3  6 6 1 2 1.41 1.41
> 0 1.41  7 6 1 5.39 1.73 1.41 4.9 5.1  8 6 1 5.48 2.45 3.61 3.32 4.9  1 7 1
> 4.69 2 1 4.12 4.24  2 7 1 3.46 2 2.83 0 2.83  3 7 1 2.45 2.24 1 0 1  4 7 1
> 5.39 1.73 0 5.1 5.1  5 7 1 3.74 2.45 1 2.65 2.83  6 7 1 1.73 1.73 0 0 0  7 7
> 1 3.74 1 1 3.46 3.61  8 7 1 3.32 2.45 2.24 0 2.24  1 8 1 4.24 2 1.73 3.32
> 3.74  2 8 1 0 0 0 0 0  3 8 1 3 1.73 2.45 0 2.45  4 8 1 1 1 0 0 0  5 8 1 3
> 2.24 0 2 2  6 8 1 2 1.41 1.41 0 1.41  7 8 1 3.16 2 0 2.45 2.45  8 8 1 3.46
> 2.45 2.45 0 2.45  1 9 1 3.16 1.73 0 2.65 2.65  2 9 1 1 1 0 0 0  3 9 1 2.83 2
> 2 0 2  4 9 1 1.41 1.41 0 0 0  5 9 1 5.48 1.73 0 5.2 5.2  6 9 1 2.45 1.41
> 1.73 1 2  7 9 1 3.46 2.24 0 2.65 2.65  8 9 1 2.45 2.24 1 0 1  1 10 1 3.16
> 1.41 1 2.65 2.83  2 10 1 1 1 0 0 0  3 10 1 2.65 2 1 1.41 1.73  4 10 1 3 1
> 1.41 2.45 2.83  5 10 1 1.73 1.73 0 0 0  6 10 1 3.61 1.41 2.45 2.24 3.32  7
> 10 1 4.12 2 1 3.46 3.61  8 10 1 2.24 2.24 0 0 0
>




More information about the R-help mailing list