[R] Multiple comparisons: was Re: langage R

2007-04-16 Thread Richard M. Heiberger
See library(multcomp) and
?glht
?contrMat
for several procedures for multiple comparisons.
The Newman Keuls test is not on the list.  The related Tukey method
is on the list.

__
R-help@stat.math.ethz.ch mailing list
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.


Re: [R] Multiple comparisons when interacction]

2007-02-24 Thread Jorge Lampurlanes Castel
Hello,

I send the message again with the data file as txt because it seems not to
be accepted as csv in the R-help list.

Data comes from a multiyear field experiment in which 4 levels of a
treatment (2, 3, 4, 6) are compared to see the effect on yield. It is a
randomized complete block design.

The SAS code follows:

options ls=95;
data uno;
infile 'data.txt' delimiter=';' firstobs=2;
input year plot block treat yield;
run;

proc mixed data=uno;
 class treat year block;
 model yield=block year treat treat*year;
 lsmeans year treat  /pdiff;
 lsmeans treat*year /slice=year pdiff;
 ods output diffs=dos;
run;

data tres;
  set dos;
  if year=_year;
proc print data=tres;
  var year _year treat _treat estimate stderr df tvalue probt;
run;

Data are attached as a file: data.csv.

In fact, I do not know if this is the best approach to analyze the data:

- Should block be considered as random? We use the same file and
randomization every year. We are interested in the long term effect of the
treatment.
- Data should be considered as repeated measurements over time (years)?

In multcomp package:

- What is the equivalence between the tests proposed  (Sequen, AVE,
Changepoint, Williams, Marcus, McDermott) and the tests agronomist
are used to do: LSD (least significant difference), Duncan multiple range
test, Scheffe, S-N-K (Student-Newman-Keuls)?


Thanks a lot for your interest.

Jorge Lampurlanés
Agronomist


 Is it possible to do this analysis in R?

 Yes, it is possible.  The syntax isn't in place yet.

 If you send me the complete SAS code and data for an example using slice,
 I will duplicate it for you in the multcomp package in R.  I will send
 that
 to the R-help list and to Torsten and it will bring us one step closer
 to the syntax.

 The example I showed before was designed to get the same answer as S-Plus
 multicomp using the adjust= argument.

 Rich

YEAR;PLOT;BLOC;LEVEL;YIELD
15;1;1;3;3896.00
15;2;1;2;3881.33
15;3;1;4;3394.11
15;4;1;6;3261.11
15;5;2;6;3273.66
15;6;2;4;3568.89
15;7;2;2;3535.33
15;8;2;3;3218.66
15;9;3;3;3311.00
15;10;3;4;3458.77
15;11;3;2;3543.44
15;12;3;6;2684.00
15;13;4;4;3591.77
15;14;4;3;3555.55
15;15;4;2;3511.11
15;16;4;6;2755.55
16;1;1;3;2736.33
16;2;1;2;2769.66
16;3;1;4;2353.11
16;4;1;6;2964.44
16;5;2;6;2631.11
16;6;2;4;2882.77
16;7;2;2;2203.66
16;8;2;3;2636.89
16;9;3;3;2461.55
16;10;3;4;2285.00
16;11;3;2;2361.66
16;12;3;6;2636.89
16;13;4;4;2639.78
16;14;4;3;2596.66
16;15;4;2;2928.44
16;16;4;6;2745.44
17;1;1;3;2751.63
17;2;1;2;2855.81
17;3;1;4;2089.71
17;4;1;6;4096.04
17;5;2;6;4254.52
17;6;2;4;2483.10
17;7;2;2;2920.86
17;8;2;3;3399.48
17;9;3;3;3443.28
17;10;3;4;3447.03
17;11;3;2;3839.87
17;12;3;6;4135.01
17;13;4;4;3549.82
17;14;4;3;3542.12
17;15;4;2;3597.47
17;16;4;6;4017.49
18;1;1;3;2106.00
18;2;1;2;2622.78
18;3;1;4;3023.33
18;4;1;6;3811.44
18;5;2;6;3204.11
18;6;2;4;2739.00
18;7;2;2;2700.33
18;8;2;3;2273.89
18;9;3;3;2131.78
18;10;3;4;3075.00
18;11;3;2;2997.44
18;12;3;6;3010.33
18;13;4;4;2868.22
18;14;4;3;2519.44
18;15;4;2;2855.33
18;16;4;6;3462.55
19;1;1;3;3802.27
19;2;1;2;3987.03
19;3;1;4;3879.28
19;4;1;6;2992.50
19;5;2;6;2221.98
19;6;2;4;3739.80
19;7;2;2;4523.07
19;8;2;3;4460.97
19;9;3;3;4587.39
19;10;3;4;4104.34
19;11;3;2;4018.42
19;12;3;6;2504.81
19;13;4;4;3819.31
19;14;4;3;4163.23
19;15;4;2;3718.99
19;16;4;6;2399.38
20;1;1;3;2320.64
20;2;1;2;1540.83
20;3;1;4;1473.81
20;4;1;6;1271.28
20;5;2;6;1025.46
20;6;2;4;1488.39
20;7;2;2;1728.99
20;8;2;3;2196.10
20;9;3;3;2037.82
20;10;3;4;1745.93
20;11;3;2;1876.27
20;12;3;6;1045.36
20;13;4;4;1376.80
20;14;4;3;2176.18
20;15;4;2;1985.51
20;16;4;6;647.27
21;1;1;3;5183.94
21;2;1;2;3583.61
21;3;1;4;3041.82
21;4;1;6;3645.95
21;5;2;6;3525.90
21;6;2;4;2989.62
21;7;2;2;3174.04
21;8;2;3;3021.54
21;9;3;3;2985.57
21;10;3;4;3099.75
21;11;3;2;3214.95
21;12;3;6;3454.56
21;13;4;4;3168.78
21;14;4;3;3244.26
21;15;4;2;3747.98
21;16;4;6;3060.55
22;1;1;3;2920.53
22;2;1;2;1987.68
22;3;1;4;2235.97
22;4;1;6;2693.58
22;5;2;6;2461.07
22;6;2;4;2255.39
22;7;2;2;2815.35
22;8;2;3;3192.49
22;9;3;3;2909.77
22;10;3;4;2832.01
22;11;3;2;2663.89
22;12;3;6;2010.96
22;13;4;4;2471.86
22;14;4;3;2615.70
22;15;4;2;2981.77
22;16;4;6;1719.13
23;1;1;3;4134.62
23;2;1;2;3276.45
23;3;1;4;3136.52
23;4;1;6;3784.49
23;5;2;6;3817.49
23;6;2;4;3506.78
23;7;2;2;4109.16
23;8;2;3;4009.86
23;9;3;3;4099.24
23;10;3;4;4111.49
23;11;3;2;4388.40
23;12;3;6;4090.12
23;13;4;4;4001.93
23;14;4;3;4195.77
23;15;4;2;4247.79
23;16;4;6;4119.71
24;1;1;3;1157.99
24;2;1;2;1008.99
24;3;1;4;822.09
24;4;1;6;565.01
24;5;2;6;518.99
24;6;2;4;889.10
24;7;2;2;1048.63
24;8;2;3;1396.62
24;9;3;3;1238.06
24;10;3;4;1061.40
24;11;3;2;1198.28
24;12;3;6;761.29
24;13;4;4;805.48
24;14;4;3;1172.09
24;15;4;2;1055.87
24;16;4;6;527.04__
R-help@stat.math.ethz.ch mailing list
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, 

[R] multiple comparisons

2007-02-19 Thread Petra Finkenbein
Dear R users,
I need a professional help:

i am a relatively new R user and I am just writing my diploma tesis where I 
have to conduct some multiple comparison.
I am searching a method which include interaction between fixed factors. The 
following is my model: 
lmer(Leaf~water*region+(1|pop)+(1|pop:sib)+(1|block)+(1|block:pool),data=datx,method=ML)
I want to compare: leaf dependent from water * region.

I would prefer to make a comparision according to tukey or student newman keuls 
if this is possible. 
I am looking forward to your reply, sincerely Petra:-)

__
R-help@stat.math.ethz.ch mailing list
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.


Re: [R] Multiple comparisons when interacction

2007-02-16 Thread Jorge Lampurlanes Castel
Hello,

Data comes from a multiyear field experiment in which 4 levels of a
treatment (2, 3, 4, 6) are compared to see the effect on yield. It is a
randomized complete block design.

The SAS code follows:

options ls=95;
data uno;
infile 'data.csv' delimiter=';' firstobs=2;
input year plot block treat yield;
run;

proc mixed data=uno;
 class treat year block;
 model yield=block year treat treat*year;
 lsmeans year treat  /pdiff;
 lsmeans treat*year /slice=year pdiff;
 ods output diffs=dos;
run;

data tres;
  set dos;
  if year=_year;
proc print data=tres;
  var year _year treat _treat estimate stderr df tvalue probt;
run;

Data are attached as a file: data.csv.

In fact, I do not know if this is the best approach to analyze the data:

- Should block be considered as random? We use the same file and
randomization every year. We are interested in the long term effect of the
treatment.
- Data should be considered as repeated measurements over time (years)?

In multcomp package:

- What is the equivalence between the tests proposed  (Sequen, AVE,
Changepoint, Williams, Marcus, McDermott) and the tests agronomist
are used to do: LSD (least significant difference), Duncan multiple range
test, Scheffe, S-N-K (Student-Newman-Keuls)?


Thanks a lot for your interest.

Jorge Lampurlanés
Agronomist


 Is it possible to do this analysis in R?

 Yes, it is possible.  The syntax isn't in place yet.

 If you send me the complete SAS code and data for an example using slice,
 I will duplicate it for you in the multcomp package in R.  I will send
 that
 to the R-help list and to Torsten and it will bring us one step closer
 to the syntax.

 The example I showed before was designed to get the same answer as S-Plus
 multicomp using the adjust= argument.

 Rich


__
R-help@stat.math.ethz.ch mailing list
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.


Re: [R] Multiple comparisons when interacction

2007-02-16 Thread Jorge Lampurlanes Castel
Data is here.

I'm sorry.

 Is it possible to do this analysis in R?

 Yes, it is possible.  The syntax isn't in place yet.

 If you send me the complete SAS code and data for an example using slice,
 I will duplicate it for you in the multcomp package in R.  I will send
 that
 to the R-help list and to Torsten and it will bring us one step closer
 to the syntax.

 The example I showed before was designed to get the same answer as S-Plus
 multicomp using the adjust= argument.

 Rich



-- 
**
Jorge Lampurlanés Castel
Departament d'Enginyeria Agroforestal
Escola Tècnica Superior d'Enginyeria Agrària
Universitat de Lleida
Avinguda Rovira Roure, 191
25198-LLEIDA
SPAIN

Tl.: +34 973 70 25 37
Fax.:+34 073 70 26 73
e-mail: [EMAIL PROTECTED]
**
__
R-help@stat.math.ethz.ch mailing list
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.


[R] Multiple comparisons

2007-02-13 Thread Pablo Faundez Hoffmann
Dear list,

I have to do an ANOVA analysis with one fixed effect A and one random 
effect SUBJECT. TO do this I used aov in the form
  aov.m1 - aov(depvar ~ A + Error(SUBJECT/(A)));

My question is if I obtain significant differences within the strata, 
does it make any sense to make multiple comparisons in order to know 
what levels of the factor are significant?. I asked this because I get 
an error when I try

TukeyHSD(aov.m1), and I am not sure if this is correct.

thanks

Pablo Hoffmann

__
R-help@stat.math.ethz.ch mailing list
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.


Re: [R] Multiple comparisons when interacction

2007-01-30 Thread Jorge Lampurlanes Castel
As I understand from the WoodEnergy example in package HH, You are
proposing to compute a separate lm for each level of YEAR factor to
compare TIL means.
This is the way I used to do this kind of analysis.

But now, it is also possible, with PROC GLM, to adjust only the general
model (variable ~ BLOC + TIL * YEAR ) and then to compare TIL means inside
every YEAR with the SLICE option.

I am not statistician but I think the difference is that, in the first
approach, we use a different error term for every YEAR, whereas in the
second approach, we use the same error term for all comparisons.

Perhaps the differences between both approaches are negligible. If not, it
is possible to do this analysis in R?

Thanks a lot.

-- 
**
Jorge Lampurlanés Castel
Departament d'Enginyeria Agroforestal
Escola Tècnica Superior d'Enginyeria Agrària
Universitat de Lleida
Avinguda Rovira Roure, 191
25198-LLEIDA
SPAIN

Tl.: +34 973 70 25 37
Fax.:+34 073 70 26 73
e-mail: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch mailing list
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.


Re: [R] Multiple comparisons when interacction

2007-01-30 Thread Jorge Lampurlanes Castel
Yes, it can be done.  It is not currently easy because multcomp doesn't
have the syntax yet.  Making this easy is on Torsten's to-do list for the
multcomp package.

See the MMC.WoodEnergy example in the HH package.  The current version on
CRAN
is HH_1.17.  Please see the discussion of this example in R-help:

https://stat.ethz.ch/pipermail/r-help/2007-January/123451.html

Rich

__
R-help@stat.math.ethz.ch mailing list
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.


[R] Multiple comparisons when interacction

2007-01-29 Thread Jorge Lampurlanes Castel
In the model:

  lm.1 - lm(variable ~ BLOC + TIL * YEAR , data=selvanera)


I found TIL*YEAR interaction significant. Then I am trying to compare
means of the different levels of TIL inside every YEAR using:

  mc.2 - glht(lm.1, linfct = mcp(TIL*YEAR=Tukey))
  summary(mc.2, test = univariate())

but it does not work.

There is any way of doing this, like the SLICE option in PROC GLM (SAS)?

Thanks a lot,

Jorge



-- 
**
Jorge Lampurlanés Castel
Departament d'Enginyeria Agroforestal
Escola Tècnica Superior d'Enginyeria Agrària
Universitat de Lleida
Avinguda Rovira Roure, 191
25198-LLEIDA
SPAIN

Tl.: +34 973 70 25 37
Fax.:+34 073 70 26 73
e-mail: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch mailing list
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.


Re: [R] multiple comparisons of time series data (Stephan Moratti)

2006-05-30 Thread Stephan Moratti

To account for the strong serial correlation you 
could try the lme() function of the nlme package. 
There you can apply different covariance 
structures in your linear model such as a 
first-order autoregressive covariance structure (AR1).

example:

model.fit - lme(response ~ condition * time, 
data = time.series.data, random=~1|case, correlation = corCAR1());

This model uses an autoregressive process for 
continous data. The random expression defines the 
intercept for each case (or observation, subject) 
as a random factor. Condition and time would be 
fixed factors in this case. See also help(lme) and help(corClasses).

Hopes that helps,

Stephan




Stephan Moratti, PhD
Centro de Magnetoencefalografía Dr. Perez Modrego
Faculdad de Medicina
Universidad Complutense de Madrid
Pabellón 8
Avda. Complutense, s/n
28040 Madrid
Spain
email: [EMAIL PROTECTED]
Tel.:   +34 91 394 2292
Fax.:   +34 91 394 2294  
[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] multiple comparisons of time series data

2006-05-29 Thread Thomas Adams
Kyle,

You might try the Wilcoxon Rank Sum test (and there is also the paired 
rank sum test) that may be useful. Both are found in R. There is an 
application of the test in the textbook by Loucks, D.P., Stedinger J.R., 
and Haith, D., 1981. Water Resources Systems Planning and Analysis, 
Prentice-Hall, Eaglewood Cliffs, New Jersey. I hope this helps…

Go HOKIES!

Tom


Kyle Hall wrote:
 I am interested in a statistical comparison of multiple (5) time series' 
 generated from modeling software (Hydrologic Simulation Program Fortran). The 
 model output simulates daily bacteria concentration in a stream. The multiple 
 time series' are a result of varying our representation of the stream within 
 the model.

 Our main question is: Do the different methods used to represent a stream 
 produce different results at a statistically significant level?

 We want to compare each otput time series to determine if there is a 
 difference before looking into the cause within the model.  In a previous 
 study, the Kolmogorov-Smirnov k-sample test was used to compare multiple time 
 series'.

 I am unsure about the strength of the Kolmogorov-Smirnov test and I have set 
 out to determine if there are any other tests to compare multiple time 
 series'.

 I know htat R has the ks.test but I am unsure how this test handles multiple 
 comparisons.  Is there something similar to a pairwise.t.test with a 
 bonferroni corection, only with time series data?

 Does R currently (v 2.3.0) have a comparison test that takes into account the 
 strong serial correlation of time series data?


 Kyle Hall

 Graduate Research Assistant
 Biological Systems Engineering
 Virginia Tech

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
   


-- 
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  [EMAIL PROTECTED]

VOICE:  937-383-0528
FAX:937-383-0033

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] multiple comparisons of time series data

2006-05-28 Thread Spencer Graves
PAIRWISE KOLMOGOROV-SMIRNOV:

  I don't know, but it looks like you could just type pairwise.t.test 
at a command prompt, copy the code into an R script file, and create a 
function pairwise.ks.test just by changing the call to t.test with 
one to ks.test.  Try it.  If you have trouble making it work, submit a 
post on that.

  I would NOT do this, however, because the ks.test assumes samples 
of INDEPENDENT observations.  If you've got time series, I would expect 
the assumption of independence to be violated, and I would not believe 
the results of a KS test.  If you what to try what I just suggested, 
please also try it with multiple time series WITHOUT varying our 
representation of the stream within the model, preferably several times.

COMPARING MULTIPLE TIME SERIES

  If I had k different time series to compare, I might proceed as 
follows:

  1.  Make normal probability plots using, e.g., qqnorm.  If the 
observations did NOT look normal, I'd consider some transformation.  If 
the numbers were all positive, I might consider using the boxcox 
function in library(MASS) to help select one.  However, I wouldn't 
completely believe the results, because this also assumes the 
observations are independent, and I know they're not.

  2.  Try to fit some traditional time series model as describe, e.g., 
in the chapter on time series on Venables and Ripley (2002) Modern 
Applied Statistics with S (Springer).  There are better books on time 
series, but this is probably the first book I would recommend to anyone 
using R, and this chapter would be a reasonable start.  I'd play with 
this until I seemed to get sensible fits for nearly all series with the 
same model and with residuals that looked fairly though not totally (a) 
white by the Box-Ljung criteria, and (b) normal in normal probability 
plots.  If I saw consistent non-normal behavior in the residuals, it 
would indicate a problem bigger than I can handle in a brief email like 
this.

  3.  With k different time series, most of the results of 2 could be 
summarized in k sets of estimated regression coefficients, all for the 
same model, with estimated standard errors plus whitened residuals.  If 
you had m parameters, each pair of time series could then be summarized 
into m z-scores = (b.i-b.j)/(var.b.i+var.b.j), which could then be 
further converted into m p.values.  You would then add the p.values from 
ks.test, making (m+1) p.values for each of the k*(k-1)/2 = 10 pairs of 
series with k = 5 series.  I'd then feed these k*(m+1) p.values into 
p.adjust to get an answer.  (Note:  pairwise.t.test calls 
pairwise.table, which further calls p.adjust.  I didn't know any of 
this before I read your post.)  I might experiment with the different 
methods for p.adjust, and I got different answers from the different 
methods, I might worry about which to believe.  The Bonferroni is the 
simplest, most widely known and understood, but also perhaps the most 
conservative.  I might tend to believe some of the others more, but if I 
got different answers, I'd suspect that the case was marginal, and I 
might want to generate other sets of simulations and try those.

  4.  There are other facilities in R for multiple comparisons, e.g., 
in the multcomp and pgirmess packages.  Before I actually undertook 
steps 1, 2, and 3, above, I might review these packages to familiarize 
myself more with their contents.

  5.  Virginia Tech has an excellent Statistics department with a 
consulting center.  You might try them.

  hope this helps,
  Spencer Graves

Kyle Hall wrote:
 I am interested in a statistical comparison of multiple (5) time series' 
 generated from modeling software (Hydrologic Simulation Program Fortran). The 
 model output simulates daily bacteria concentration in a stream. The multiple 
 time series' are a result of varying our representation of the stream within 
 the model.
 
 Our main question is: Do the different methods used to represent a stream 
 produce different results at a statistically significant level?
 
 We want to compare each otput time series to determine if there is a 
 difference before looking into the cause within the model.  In a previous 
 study, the Kolmogorov-Smirnov k-sample test was used to compare multiple time 
 series'.
 
 I am unsure about the strength of the Kolmogorov-Smirnov test and I have set 
 out to determine if there are any other tests to compare multiple time 
 series'.
 
 I know htat R has the ks.test but I am unsure how this test handles multiple 
 comparisons.  Is there something similar to a pairwise.t.test with a 
 bonferroni corection, only with time series data?
 
 Does R currently (v 2.3.0) have a comparison test that takes into account the 
 strong serial correlation of time series data?
 
 
 Kyle Hall
 
 Graduate Research Assistant
 Biological Systems Engineering
 Virginia Tech
 
 

[R] multiple comparisons of time series data

2006-05-26 Thread Kyle Hall
I am interested in a statistical comparison of multiple (5) time series' 
generated from modeling software (Hydrologic Simulation Program Fortran). The 
model output simulates daily bacteria concentration in a stream. The multiple 
time series' are a result of varying our representation of the stream within 
the model.

Our main question is: Do the different methods used to represent a stream 
produce different results at a statistically significant level?

We want to compare each otput time series to determine if there is a 
difference before looking into the cause within the model.  In a previous 
study, the Kolmogorov-Smirnov k-sample test was used to compare multiple time 
series'.

I am unsure about the strength of the Kolmogorov-Smirnov test and I have set 
out to determine if there are any other tests to compare multiple time 
series'.

I know htat R has the ks.test but I am unsure how this test handles multiple 
comparisons.  Is there something similar to a pairwise.t.test with a 
bonferroni corection, only with time series data?

Does R currently (v 2.3.0) have a comparison test that takes into account the 
strong serial correlation of time series data?


Kyle Hall

Graduate Research Assistant
Biological Systems Engineering
Virginia Tech

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] multiple comparisons for proportions

2005-09-13 Thread Chris Buddenhagen
Dear all

 

I am still fishing for help on this theme. In Zar 1999 page 563-565 he
describes a Tukey-type multiple comparison for testing among proportions.
It involves comparisons of ranked proportions transformed to degrees. In the
following pages there are a couple of similar comparisons.

 

I cannot find an example of this in R. Is there such a thing?

 

Cheers

 

Chris Buddenhagen, Botany Department, Charles Darwin Research Station, Santa
Cruz,Galapagos. Mail: Charles Darwin Foundation, Casilla 17-01-3891 Avenida
6 de Diciembre N36-109 y Pasaje California Quito, ECUADOR

 





__
EL CONTENIDO DE ESTE MENSAJE ES DE ABSOLUTA RESPONSABILIDAD DEL AUTOR.
FUNDACION CHARLES DARWIN
WWW.DARWINFOUNDATION.ORG
[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Multiple comparisons like a Chi2 or Fisher's exact test

2005-09-12 Thread Chris Buddenhagen
Dear all

 

I have an experiment where plots  either have or have not regrown (in 40
plots) after receiving 12 different herbicide treatments and a control (no
treatment). The data are significant with a Chi2, but to later distinguish
if the differences are significant between each of the 12 treatments apart I
need to do multiple Chi2 s between each. Is there a way to run those
multiple Chi2 or something like them so that each comparison is done in an
automated fashion between the treatments? Have I made myself clear?

 

Chris Buddenhagen, Botany Department, Charles Darwin Research Station, Santa
Cruz,Galapagos. Mail: Charles Darwin Foundation, Casilla 17-01-3891 Avenida
6 de Diciembre N36-109 y Pasaje California Quito, ECUADOR

 





__
EL CONTENIDO DE ESTE MENSAJE ES DE ABSOLUTA RESPONSABILIDAD DEL AUTOR.
FUNDACION CHARLES DARWIN
WWW.DARWINFOUNDATION.ORG
[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] multiple comparisons for lme using multcomp

2005-03-10 Thread Michaël Coeurdassier
Dear R-help list,

I would like to perform multiple comparisons for lme.  Can you report to me 
if my way to is correct or not?  Please, note that I am not nor a 
statistician nor a mathematician, so, some understandings are sometimes 
quite hard for me.   According to the previous helps on the topic in R-help 
list May 2003 (please, see Torsten Hothorn advices) and books such as 
Venables  Ripley or Pinheiro  Bates. I need multcomp library. I followed 
the different examples and get these results :

In this example, response is the mass of earthworms after one month of 
exposure to different concentrations of pollutants (treatment). The 
experimental design was three containers per treatment with five animals in 
each container (or less if mortality occurred). Containers were referred as 
box and considered as the random variable.

  tab-read.delim(example1.txt)
  tab
treatment box response
1control   a  1.8
2control   a  2.3
3control   a  1.3
4control   a  0.8
5control   a  2.0
6control   b  1.1
7control   b  2.2
8control   b  1.3
9control   b  2.0
10   control   b  1.3
11   control   c  1.5
12   control   c  1.4
13   control   c  2.1
14   control   c  1.7
15   control   c  1.3
16 Al100   d  1.6
17 Al100   d  2.1
18 Al100   d  0.7
19 Al100   d  1.8
20 Al100   d  1.2
21 Al100   e  1.5
22 Al100   e  1.5
23 Al100   e  2.0
24 Al100   e  1.0
25 Al100   e  1.6
26 Al100   f  0.9
27 Al100   f  2.0
28 Al100   f  1.9
29 Al100   f  1.7
30 Al100   f  1.7
…
68 Al800   q  1.0
69 Al800   r  0.8
70 Al800   r  0.9
71 Al800   r  0.9
72 Al800   r  0.6
73 Al800   s  0.9
74 Al800   s  1.0
75 Al800   s  0.8
76 Al800   s  0.8
77 Al800   s  0.7

  attach(tab)
  library(nlme)
  lm1-lme(response~treatment,random=~1|box)
  library(multcomp)
Loading required package: mvtnorm

  # first way to do (seem uncorrect)
  summary(csimtest(coef(lm1),vcov(lm1),cmatrix=contrMat(table(treatment),
type=Tukey),df=59))
Error in csimtest(coef(lm1), vcov(lm1), cmatrix = 
contrMat(table(treatment), : estpar not a vector

  #indeed
  coef(lm1)
   (Intercept) treatmentAl200 treatmentAl400 treatmentAl600 treatmentAl800
a1.546679 -0.1648540 -0.4895219 -0.6383375 -0.7066632
b1.546657 -0.1648540 -0.4895219 -0.6383375 -0.7066632
c1.546664 -0.1648540 -0.4895219 -0.6383375 -0.7066632
d1.546643 -0.1648540 -0.4895219 -0.6383375 -0.7066632
…
s1.546667 -0.1648540 -0.4895219 -0.6383375 -0.7066632
   treatmentcontrol
a 0.06
b 0.06
c 0.06
d 0.06
…
s 0.06

  # second way to do could be to get a vector for lm1 coefficient removing 
intercept(is it correct?)
  vect-as.numeric(coef(lm1)[1,])
  vect
[1]  1.5466787 -0.1648540 -0.4895219 -0.6383375 -0.7066632  0.060
  
summary(csimtest(vect,vcov(lm1),cmatrix=contrMat(table(treatment),type=Tukey),df=59))

  Simultaneous tests: user-defined contrasts

  user-defined contrasts for factor

Contrast matrix:
   Al100 Al200 Al400 Al600 Al800 control
Al200-Al100  -1 10 00   0
Al400-Al100  -1 0 1 0 0   0
Al600-Al100  -1 0 01 0   0
Al800-Al100  -1 0 00 1   0
control-Al100-1 0 00 0   1
Al400-Al200   0-1 10 0   0
Al600-Al200   0-1 0 1 0   0
Al800-Al200   0-1 0 01   0
control-Al200 0-1 0 00   1
Al600-Al400   0 0-1 10   0
Al800-Al400   0 0-1 0 1   0
control-Al400 0 0-1 0 0   1
Al800-Al600   0 00-1 1   0
control-Al600 0 00-1 0   1
control-Al800 0 00 0-1   1


Absolute Error Tolerance:  0.001

Coefficients:
   Estimate t value Std.Err. p raw p Bonf p adj
Al800-Al100 -2.253 -10.4670.213 0.000  0.000 0.000
Al600-Al100 -2.185 -10.3890.207 0.000  0.000 0.000
Al400-Al100 -2.036  -9.8500.210 0.000  0.000 0.000
Al200-Al100 -1.712  -8.0510.215 0.000  0.000 0.000
control-Al100   -1.487  -7.2430.205 0.000  0.000 0.000
control-Al8000.767  -5.2820.143 0.000  0.000 0.000
control-Al6000.698  -5.0720.148 0.000  0.000 0.000
control-Al4000.550  -4.1600.155 0.000  0.001 0.001
Al800-Al200 -0.542  -3.4880.141 0.001  0.006 0.006
Al600-Al200 -0.473  -3.1910.140 0.002  0.014 0.012
Al400-Al200 -0.325  -2.2670.147 0.027  0.135 0.110
control-Al2000.225  -1.5930.132 0.116  0.466 0.341
Al800-Al400 -0.217  -1.4750.152 

Re: [R] multiple comparisons for lme using multcomp

2005-03-10 Thread Peter Dalgaard
Michaël Coeurdassier [EMAIL PROTECTED] writes:

 summary(csimtest(vect,vcov(lm1),cmatrix=contrMat(table(treatment),type=Tukey),df=59))

 Coefficients:
Estimate t value Std.Err. p raw p Bonf p adj
 Al800-Al100 -2.253 -10.4670.213 0.000  0.000 0.000
 Al600-Al100 -2.185 -10.3890.207 0.000  0.000 0.000
 Al400-Al100 -2.036  -9.8500.210 0.000  0.000 0.000
 Al200-Al100 -1.712  -8.0510.215 0.000  0.000 0.000
 control-Al100   -1.487  -7.2430.205 0.000  0.000 0.000
 control-Al8000.767  -5.2820.143 0.000  0.000 0.000
 control-Al6000.698  -5.0720.148 0.000  0.000 0.000
 control-Al4000.550  -4.1600.155 0.000  0.001 0.001
 Al800-Al200 -0.542  -3.4880.141 0.001  0.006 0.006
 Al600-Al200 -0.473  -3.1910.140 0.002  0.014 0.012
 Al400-Al200 -0.325  -2.2670.147 0.027  0.135 0.110
 control-Al2000.225  -1.5930.132 0.116  0.466 0.341
 Al800-Al400 -0.217  -1.4750.152 0.145  0.466 0.341
 Al600-Al400 -0.149  -1.0640.138 0.292  0.583 0.466
 Al800-Al600 -0.068  -0.4490.145 0.655  0.655 0.655
 
   #a friend told me that it is possible to do multiple comparisons for lme 
 in a simplest way, i.e. :
   anova(lm1,L=c(treatmentcontrol=1,treatmentAl200=-1))
 F-test for linear combination(s)
treatmentAl200 treatmentcontrol
-11
numDF denDF  F-value p-value
 1 112 2.538813  0.1371
 
   anova(lm1,L=c(treatmentcontrol=1,treatmentAl400=-1))
 F-test for linear combination(s)
treatmentAl400 treatmentcontrol
-11
numDF denDF  F-value p-value
 1 112 17.30181  0.0013
 
   anova(lm1,L=c(treatmentcontrol=1,treatmentAl600=-1))
 F-test for linear combination(s)
treatmentAl600 treatmentcontrol
-11
numDF denDF  F-value p-value
 1 112 25.72466   3e-04
 
   anova(lm1,L=c(treatmentcontrol=1,treatmentAl800=-1))
 F-test for linear combination(s)
treatmentAl800 treatmentcontrol
-11
numDF denDF F-value p-value
 1 112 27.9043   2e-04
 
   # however, p values are different that those obtained above. Is this way 
 OK or not?


Notice that in all cases, the F-value is exactly the square of the
t-value from Csimtest. The main difference is that you have claimed
that the vcov matrix has 59 DF, whereas the lme analysis says 12. I'd
suspect the latter to be (more) correct. Apart from that, notice that
the L approach at best gives you the p raw value, i.e., it is
uncorrected for multiple testing.


-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] multiple comparisons for lme using multcomp

2005-03-09 Thread Michaël Coeurdassier
Dear R-help list,

I would like to perform multiple comparisons for lme.  Can you report to me 
if my way to is correct or not?  Please, note that I am not nor a 
statistician nor a mathematician, so, some understandings are sometimes 
quite hard for me.   According to the previous helps on the topic in R-help 
list May 2003 (please, see Torsten Hothorn advices) and books such as 
Venables  Ripley or Pinheiro  Bates. I need multcomp library. I followed 
the different examples and get these results :

In this example, response is the mass of earthworms after one month of 
exposure to different concentrations of pollutants (treatment). The 
experimental design was three containers per treatment with five animals in 
each container (or less if mortality occurred). Containers were referred as 
box and considered as the random variable.

  tab-read.delim(example1.txt)
  tab
treatment box response
1control   a  1.8
2control   a  2.3
3control   a  1.3
4control   a  0.8
5control   a  2.0
6control   b  1.1
7control   b  2.2
8control   b  1.3
9control   b  2.0
10   control   b  1.3
11   control   c  1.5
12   control   c  1.4
13   control   c  2.1
14   control   c  1.7
15   control   c  1.3
16 Al100   d  1.6
17 Al100   d  2.1
18 Al100   d  0.7
19 Al100   d  1.8
20 Al100   d  1.2
21 Al100   e  1.5
22 Al100   e  1.5
23 Al100   e  2.0
24 Al100   e  1.0
25 Al100   e  1.6
26 Al100   f  0.9
27 Al100   f  2.0
28 Al100   f  1.9
29 Al100   f  1.7
30 Al100   f  1.7
…
68 Al800   q  1.0
69 Al800   r  0.8
70 Al800   r  0.9
71 Al800   r  0.9
72 Al800   r  0.6
73 Al800   s  0.9
74 Al800   s  1.0
75 Al800   s  0.8
76 Al800   s  0.8
77 Al800   s  0.7

  attach(tab)
  library(nlme)
  lm1-lme(response~treatment,random=~1|box)
  library(multcomp)
Loading required package: mvtnorm

  # first way to do (seem uncorrect)
  summary(csimtest(coef(lm1),vcov(lm1),cmatrix=contrMat(table(treatment),
type=Tukey),df=59))
Error in csimtest(coef(lm1), vcov(lm1), cmatrix = 
contrMat(table(treatment), : estpar not a vector

  #indeed
  coef(lm1)
   (Intercept) treatmentAl200 treatmentAl400 treatmentAl600 treatmentAl800
a1.546679 -0.1648540 -0.4895219 -0.6383375 -0.7066632
b1.546657 -0.1648540 -0.4895219 -0.6383375 -0.7066632
c1.546664 -0.1648540 -0.4895219 -0.6383375 -0.7066632
d1.546643 -0.1648540 -0.4895219 -0.6383375 -0.7066632
…
s1.546667 -0.1648540 -0.4895219 -0.6383375 -0.7066632
   treatmentcontrol
a 0.06
b 0.06
c 0.06
d 0.06
…
s 0.06

  # second way to do could be to get a vector for lm1 coefficient removing 
intercept(is it correct?)
  vect-as.numeric(coef(lm1)[1,])
  vect
[1]  1.5466787 -0.1648540 -0.4895219 -0.6383375 -0.7066632  0.060
  
summary(csimtest(vect,vcov(lm1),cmatrix=contrMat(table(treatment),type=Tukey),df=59))

  Simultaneous tests: user-defined contrasts

  user-defined contrasts for factor

Contrast matrix:
   Al100 Al200 Al400 Al600 Al800 control
Al200-Al100  -1 1 0 0 0   0
Al400-Al100  -1 0 1 0 0   0
Al600-Al100  -1 0 0 1 0   0
Al800-Al100  -1 0 0 0 1   0
control-Al100-1 0 0 0 0   1
Al400-Al200   0-1 1 0 0   0
Al600-Al200   0-1 0 1 0   0
Al800-Al200   0-1 0 0 1   0
control-Al200 0-1 0 0 0   1
Al600-Al400   0 0-1 1 0   0
Al800-Al400   0 0-1 0 1   0
control-Al400 0 0-1 0 0   1
Al800-Al600   0 0 0-1 1   0
control-Al600 0 0 0-1 0   1
control-Al800 0 0 0 0-1   1


Absolute Error Tolerance:  0.001

Coefficients:
   Estimate t value Std.Err. p raw p Bonf p adj
Al800-Al100 -2.253 -10.4670.213 0.000  0.000 0.000
Al600-Al100 -2.185 -10.3890.207 0.000  0.000 0.000
Al400-Al100 -2.036  -9.8500.210 0.000  0.000 0.000
Al200-Al100 -1.712  -8.0510.215 0.000  0.000 0.000
control-Al100   -1.487  -7.2430.205 0.000  0.000 0.000
control-Al8000.767  -5.2820.143 0.000  0.000 0.000
control-Al6000.698  -5.0720.148 0.000  0.000 0.000
control-Al4000.550  -4.1600.155 0.000  0.001 0.001
Al800-Al200 -0.542  -3.4880.141 0.001  0.006 0.006
Al600-Al200 -0.473  -3.1910.140 0.002  0.014 0.012
Al400-Al200 -0.325  -2.2670.147 0.027  0.135 0.110
control-Al2000.225  -1.5930.132 0.116  0.466 0.341
Al800-Al400 -0.217  

RE: [R] Multiple comparisons following nlme

2005-01-11 Thread Lorenz . Gygax
 I need to do multiple comparisons following nlme analysis (Compare
 the effects of different treatments on a response measured 
 repeatedly over time;
 fixed = response ~ treat*time).

If you have an interaction it does not really make sense to conduct a
multiple comparison because the difference in treatment depends on time,
i.e. this presumed post-hoc test could only give you a correct result for
one of your points in time. Why not conduct this analysis and then interpret
the pattern based on the estimates of your parameters and/or on a graphical
display of your data?

If your interaction is non-significant and you drop it, you still have a
mulitvariate problem and I have never come across a multiple comparison test
for such multivariate problems (but perhaps someone else has a pointer). In
your case it might be enough to carefully decide on how the set contrasts.

Then, an additional issue would be what kind of multiple comparisons to
conduct (for univarite anova's there are at least a dozen methods). You can
always conduct several to see which of the comparisons are highly
significant and which ones might not be so strong. But usually you do not
learn more than what you get when you interpret your parameters and/or
graphs of your data.

... and by the way, I guess your model is using lme (linear mixed effects
model) in package nlme and not actually an nlme (non-linear mixed effects
model) itself.

Regards, Lorenz
- 
Lorenz Gygax, Dr. sc. nat.
Centre for proper housing of ruminants and pigs
Swiss Federal Veterinary Office, agroscope FAT Tänikon

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Multiple comparisons following nlme

2005-01-10 Thread Stefan Uhlig
Dear Madam or Sir,

 

I need to do multiple comparisons following nlme analysis (Compare the
effects of different treatments on a response measured repeatedly over time;
fixed = response ~ treat*time). On the web I found the notion that one might
use the L argument from ANOVA. Do you have an example to show how this works
together with nlme?  Are there other ways to do a post-hoc analysis in nlme?

 

Thank you very much.

 

Stefan Uhlig

 

Prof. Dr.Stefan Uhlig

Head Division Pulmonary Pharmacology

Research Center Borstel

Leibniz Center for Medicine and Biosciences

23845 Borstel

Germany

Tel. 04537-188 478

FAX 04537- 188 778

[EMAIL PROTECTED]

 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Multiple comparisons in a non parametric case

2004-09-08 Thread Marco Chiarandini
Thanks Rolf and Thomas,


 It looks to me like what you are doing is trying to judge
 significance of differences by non-overlap of single-sample
 confidence intervals.  While this is appealing, it's not quite
 right.


Yes, this is what I am trying to do. Apparently, when the replicates are
the same for each experimental unit and the experiment is balanced the
CI should be the same for all sample-pairs, therefore it is somehow like
having single sample CI.


 I just looked into my copy of Applied Nonparametric Statistics
 (second ed.) by Wayne W. Daniel (Duxbury, 1990) but that
 only deals with the situation where there is a single replicate
 per block-treatment combination (whereas you have 10 reps)
 and block-treatment interaction is assumed to be non-existent.


The problems (or instances of problems) are my blocking factor. But this
factor has significant interaction in the ANOVA model.


 The method that Daniel prescribes in this simple setting seems to be
 no more than applying the Bonferroni method of multiple comparisons.
 (Daniel does not say; his book is very much a cook-book.)  So you
 might simply try Bonferroni --- i.e. do all k-choose-2 pairwise
 comparisons between treatments (using the appropriate 2 sample method
 for each comparison) doing each comparison at the alpha/k-choose-2
 significance level.  Where k = the number of treatments = 4 in your
 case.  This method is not going to be super-powerful but it is
 sometimes surprizing how well Bonferroni stacks up against more
 ``sophisticated'' methods.


I knew about Bonferroni. But I am confused. I have actually two
references: Conover Practical Nonparametric statistics (page 371) and
Sheskin Handbook and Nonparmetric statistical procedures (page
675). Both these books deal with multiple comparison when the Friedman
test would be appropriate. But the formula given are different and the
CI I obtain are also different.

Sheskin, citing various sources (among them Daniel 1990), uses a formula
with the normal distribution z and adjust the alfa value according to
Bonferroni (strangely no sample statistic appears in the formula).
Conover (which is also a good reference) uses a formula with Student't
distribution but does not adjust alfa either in the example he provides
where 4 treatments are pairwise compared.

The CI I obtain are much smaller if I use the Conover procedure than the
Sheskin's. And this happens in spite of the p-adjustment in Sheskin.
Smaller CI are for me nicer because I can distinguish better differences
But the a factor of 3 between them let me doubt I can really use
Conover.

Which is your opinion?


Thansk again for the help,

Ragards,

Marco




--
Marco Chiarandini, Fachgebiet Intellektik, Fachbereich Informatik,
Technische Universität Darmstadt, Hochschulstraße 10,
D-64289 Darmstadt - Germany, Office: S2/02 Raum E317
Tel: +49 (0)6151 16-6802 Fax: +49 (0)6151 16-5326
email: [EMAIL PROTECTED]
web page: http://www.intellektik.informatik.tu-darmstadt.de/~machud

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Multiple comparisons in a non parametric case

2004-09-07 Thread Marco Chiarandini
Dear all,

I am conducting a full factorial analysis. I have one factor consisting
in algorithms, which I consider my treatments, and another factor made
of the problems I want to solve. For each problem I obtain a response
variable which is stochastic. I replicate the measure of this response
value 10 times.

When I apply ANOVA the assumptions do not hold, hence I must rely on non
parametric tests.

By transforming the response data in ranks, the Friedman test tells me
that there is statistical significance in the difference of the sum of
ranks of at least one of the treatments.

I would like now to produce a plot for the multiple comparisons similar
to the Least Significant Difference or the Tukey's Honest Significant
Difference used in ANOVA. Since I am in the non parametric case I can
not use these methods.

Instead, I compare graphically individual treatments by plotting the sum
of ranks of each treatment togehter with the 95% confidence interval. To
compute the interval I use the Friedman test as suggested by Conover in
Practical Nonparametric statistics.

I obtain something like this:

Treat. A|-+-|
Treat. B  |-+-|
Treat. C   |-+-|
Treat. D   |-+-|

The intervals have all the same spread because the number of
replications was the same for all experimental units.


I would like to know if someone in the list had a similar experience and
if what I am doing is correct. In alternative also a reference to
another list which could better fit my request is welcome.


Thank you for the help,

Marco



--
Marco Chiarandini, Fachgebiet Intellektik, Fachbereich Informatik,
Technische Universität Darmstadt, Hochschulstraße 10,
D-64289 Darmstadt - Germany, Office: S2/02 Raum E317
Tel: +49 (0)6151 16-6802 Fax: +49 (0)6151 16-5326
email: [EMAIL PROTECTED]
web page: http://www.intellektik.informatik.tu-darmstadt.de/~machud

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Multiple comparisons in a non parametric case

2004-09-07 Thread Rolf Turner
It looks to me like what you are doing is trying to judge
significance of differences by non-overlap of single-sample
confidence intervals.  While this is appealing, it's not quite
right.

I just looked into my copy of Applied Nonparametric Statistics
(second ed.) by Wayne W. Daniel (Duxbury, 1990) but that
only deals with the situation where there is a single replicate
per block-treatment combination (whereas you have 10 reps)
and block-treatment interaction is assumed to be non-existent.

The method that Daniel prescribes in this simple setting seems to be
no more than applying the Bonferroni method of multiple comparisons.
(Daniel does not say; his book is very much a cook-book.)  So you
might simply try Bonferroni --- i.e. do all k-choose-2 pairwise
comparisons between treatments (using the appropriate 2 sample method
for each comparison) doing each comparison at the alpha/k-choose-2
significance level.  Where k = the number of treatments = 4 in your
case.  This method is not going to be super-powerful but it is
sometimes surprizing how well Bonferroni stacks up against more
``sophisticated'' methods.

Daniel gives a reference to ``Nonparametric Statistical Methods'' by
Myles Hollander and Douglas A. Wolfe, New York, Wiley, 1973, for ``an
alternative multiple comparisons formula''.  I don't have this book,
and don't know what direction Hollander and Wolfe ride off in, but it
***might*** be worth trying to get your hands on it and see.

Finally --- in what way are the assumptions of Anova violated?  The
conventional wisdom is that Anova is actually quite robust to
non-normality.  Particularly when the sample size is large --- and 10
reps per treatment combination is pretty good.  Heteroskedasticity is
more of a worry, but it's not so much of a worry when the design is
nicely balanced.  As yours is.  And finally-finally --- have you
tried transforming your data to make them a bit more normal and/or
homoskedastic?

I hope this is some help.

cheers,

Rolf Turner
[EMAIL PROTECTED]

Marco Chiarandini wrote:

 I am conducting a full factorial analysis. I have one factor
 consisting in algorithms, which I consider my treatments, and another
 factor made of the problems I want to solve. For each problem I
 obtain a response variable which is stochastic. I replicate the
 measure of this response value 10 times.
 
 When I apply ANOVA the assumptions do not hold, hence I must rely on
 non parametric tests.
 
 By transforming the response data in ranks, the Friedman test tells
 me that there is statistical significance in the difference of the
 sum of ranks of at least one of the treatments.
 
 I would like now to produce a plot for the multiple comparisons
 similar to the Least Significant Difference or the Tukey's Honest
 Significant Difference used in ANOVA. Since I am in the non
 parametric case I can not use these methods.
 
 Instead, I compare graphically individual treatments by plotting the
 sum of ranks of each treatment togehter with the 95% confidence
 interval. To compute the interval I use the Friedman test as
 suggested by Conover in Practical Nonparametric statistics.
 
 I obtain something like this:
 
 Treat. A|-+-|
 Treat. B  |-+-|
 Treat. C   |-+-|
 Treat. D   |-+-|
 
 The intervals have all the same spread because the number of
 replications was the same for all experimental units.
 
 I would like to know if someone in the list had a similar experience
 and if what I am doing is correct. In alternative also a reference to
 another list which could better fit my request is welcome.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Multiple comparisons in a non parametric case

2004-09-07 Thread Spencer Graves
 Great summary, Rolf. 

 Just one minor issue that recently bit me:  In a data mining 
application with hundred of p-values, people want to make subtle 
distinctions based on extremely small p-values.  In such applications, 
even a modest amount of skewness (to say nothing of outliers) might have 
a surprising (and not necessarily monotonic) impact on p-values. 

 Best Wishes,
 Spencer Graves
Rolf Turner wrote:
It looks to me like what you are doing is trying to judge
significance of differences by non-overlap of single-sample
confidence intervals.  While this is appealing, it's not quite
right.
I just looked into my copy of Applied Nonparametric Statistics
(second ed.) by Wayne W. Daniel (Duxbury, 1990) but that
only deals with the situation where there is a single replicate
per block-treatment combination (whereas you have 10 reps)
and block-treatment interaction is assumed to be non-existent.
The method that Daniel prescribes in this simple setting seems to be
no more than applying the Bonferroni method of multiple comparisons.
(Daniel does not say; his book is very much a cook-book.)  So you
might simply try Bonferroni --- i.e. do all k-choose-2 pairwise
comparisons between treatments (using the appropriate 2 sample method
for each comparison) doing each comparison at the alpha/k-choose-2
significance level.  Where k = the number of treatments = 4 in your
case.  This method is not going to be super-powerful but it is
sometimes surprizing how well Bonferroni stacks up against more
``sophisticated'' methods.
Daniel gives a reference to ``Nonparametric Statistical Methods'' by
Myles Hollander and Douglas A. Wolfe, New York, Wiley, 1973, for ``an
alternative multiple comparisons formula''.  I don't have this book,
and don't know what direction Hollander and Wolfe ride off in, but it
***might*** be worth trying to get your hands on it and see.
Finally --- in what way are the assumptions of Anova violated?  The
conventional wisdom is that Anova is actually quite robust to
non-normality.  Particularly when the sample size is large --- and 10
reps per treatment combination is pretty good.  Heteroskedasticity is
more of a worry, but it's not so much of a worry when the design is
nicely balanced.  As yours is.  And finally-finally --- have you
tried transforming your data to make them a bit more normal and/or
homoskedastic?
I hope this is some help.
cheers,
Rolf Turner
[EMAIL PROTECTED]
Marco Chiarandini wrote:
 

I am conducting a full factorial analysis. I have one factor
consisting in algorithms, which I consider my treatments, and another
factor made of the problems I want to solve. For each problem I
obtain a response variable which is stochastic. I replicate the
measure of this response value 10 times.
When I apply ANOVA the assumptions do not hold, hence I must rely on
non parametric tests.
By transforming the response data in ranks, the Friedman test tells
me that there is statistical significance in the difference of the
sum of ranks of at least one of the treatments.
I would like now to produce a plot for the multiple comparisons
similar to the Least Significant Difference or the Tukey's Honest
Significant Difference used in ANOVA. Since I am in the non
parametric case I can not use these methods.
Instead, I compare graphically individual treatments by plotting the
sum of ranks of each treatment togehter with the 95% confidence
interval. To compute the interval I use the Friedman test as
suggested by Conover in Practical Nonparametric statistics.
I obtain something like this:
Treat. A|-+-|
Treat. B  |-+-|
Treat. C   |-+-|
Treat. D   |-+-|
The intervals have all the same spread because the number of
replications was the same for all experimental units.
I would like to know if someone in the list had a similar experience
and if what I am doing is correct. In alternative also a reference to
another list which could better fit my request is welcome.
   

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

--
Spencer Graves, PhD, Senior Development Engineer
O:  (408)938-4420;  mobile:  (408)655-4567
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Multiple comparisons: its a trap!

2004-07-25 Thread Peter Dalgaard
Barry Rowlingson [EMAIL PROTECTED] writes:

 Liaw, Andy wrote:
  Stupid me: fell into this trap:
 
 0 == 0 == 0
  [1] FALSE
 
 
   Ouch!
 
   Python's comparison operators don't have this trap, since they
 unravel each comparison pair in a chain so that:
 
(A op1 B op2 C)
 
 becomes:
 
(A op1 B) and (B op2 C)

[chop]

   Of course old hand Fortran programmers understand all this since the
 second thing they learnt (after learning how to tap the space bar six
 times) was the order of precedence of operators...

SAS does likewise, at least in recent versions. Whether this kind of
syntactical exceptions is actually helpful is debatable. The problem
is that you get to teach people that comparisons are binary operators
except when they are not... 

I wonder how Python actually manages this; doesn't look like something
that is easy to implement in a yacc-style parser.

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Multiple comparisons: its a trap!

2004-07-25 Thread Gabor Grothendieck


Peter Dalgaard [EMAIL PROTECTED] writes:
 
 Barry Rowlingson [EMAIL PROTECTED] writes:
 
  Liaw, Andy wrote:
   Stupid me: fell into this trap:
  
  0 == 0 == 0
   [1] FALSE
  
 
  Ouch!
 
  Python's comparison operators don't have this trap, since they
  unravel each comparison pair in a chain so that:
 
  (A op1 B op2 C)
 
  becomes:
 
  (A op1 B) and (B op2 C)
 
 [chop]
 
  Of course old hand Fortran programmers understand all this since the
  second thing they learnt (after learning how to tap the space bar six
  times) was the order of precedence of operators...
 
 SAS does likewise, at least in recent versions. Whether this kind of
 syntactical exceptions is actually helpful is debatable. The problem
 is that you get to teach people that comparisons are binary operators
 except when they are not...
 
 I wonder how Python actually manages this; doesn't look like something
 that is easy to implement in a yacc-style parser.

Don't know how Python does it but its not the only one and I believe its
often done like this.   Rather than have a Boolean type, NULL is defined
to be false and anything else is true.  If the comparison is TRUE then
the right argument is returned; otherwise NULL is returned.

Thus

3  5  6
== (3  5)  6
== 5  6
== 6

which is interpreted as TRUE in if statements, etc.  

Note that the 5 is only evaluated once in the above whereas in

(3  5) and (5  6)

it would evaluated twice -- not important here but if 5 is replaced
by a function with side effects then it matters.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Multiple comparisons: its a trap!

2004-07-25 Thread Ted Harding
On 25-Jul-04 Gabor Grothendieck wrote:
 Don't know how Python does it but its not the only one and
 I believe its often done like this. Rather than have a Boolean
 type, NULL is defined to be false and anything else is true.
 If the comparison is TRUE then the right argument is returned;
 otherwise NULL is returned.
 
 Thus
 
   3  5  6
   == (3  5)  6
   == 5  6
   == 6
 
 which is interpreted as TRUE in if statements, etc.  
 
 Note that the 5 is only evaluated once in the above whereas in
 
 (3  5) and (5  6)
 
 it would evaluated twice -- not important here but if 5 is replaced
 by a function with side effects then it matters.

This is weird, and I'm not sure what is being discussed here.

I had been hanging fire on this, to see what others say. Not having
seen anyone else say what I'd thought originally, here it is.

If you write, in R,

  3  5  6

you get TRUE. I understand this to be parsed as (3  5)  6,
not as (3  5) and (5  6). Am I right?

If so, then what happens depends on what (3  5) evaluates to.
In R, this is TRUE, and in R it is the case that TRUE  6:

   356
  [1] TRUE
   35
  [1] TRUE
   TRUE6
  [1] TRUE

However, in R it is also the case that

   354
  [1] TRUE

since

   TRUE4
  [1] TRUE

the point being, as I understand it, that in a numerical context

  TRUE = 1

e.g.

   TRUE + 3
  [1] 4

and, since 1  4, TRUE  4 is TRUE and so 3  5  4 is TRUE.

However,

   0.3  0.5  0.6
  [1] FALSE

for precisely the same reason.

So there should be no problem so long as you remember to bear in
mind what values binary comparisons have, following evaluation.

Best wishes to all,
Ted.



E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 167 1972
Date: 26-Jul-04   Time: 00:09:26
-- XFMail --

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Multiple comparisons: its a trap!

2004-07-25 Thread Gabor Grothendieck
 Ted.Harding at nessie.mcc.ac.uk writes:

: 
: On 25-Jul-04 Gabor Grothendieck wrote:
:  Don't know how Python does it but its not the only one and
:  I believe its often done like this. Rather than have a Boolean
:  type, NULL is defined to be false and anything else is true.
:  If the comparison is TRUE then the right argument is returned;
:  otherwise NULL is returned.
:  
:  Thus
:  
:3  5  6
:== (3  5)  6
:== 5  6
:== 6
:  
:  which is interpreted as TRUE in if statements, etc.  
:  
:  Note that the 5 is only evaluated once in the above whereas in
:  
:  (3  5) and (5  6)
:  
:  it would evaluated twice -- not important here but if 5 is replaced
:  by a function with side effects then it matters.
: 
: This is weird, and I'm not sure what is being discussed here.

We were discussing how some other languages string together comparison 
operators without an intermediate  and  to connect them.  This discussion
has nothing to do with R other than possibly to understand whether it
could fit within the R framework.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Multiple comparisons: its a trap!

2004-07-25 Thread Peter Dalgaard
Gabor Grothendieck [EMAIL PROTECTED] writes:

  Ted.Harding at nessie.mcc.ac.uk writes:
 
 : 
 : On 25-Jul-04 Gabor Grothendieck wrote:
 :  Don't know how Python does it but its not the only one and
 :  I believe its often done like this. Rather than have a Boolean
 :  type, NULL is defined to be false and anything else is true.
 :  If the comparison is TRUE then the right argument is returned;
 :  otherwise NULL is returned.
 
 : This is weird, and I'm not sure what is being discussed here.
 
 We were discussing how some other languages string together comparison 
 operators without an intermediate  and  to connect them.  This discussion
 has nothing to do with R other than possibly to understand whether it
 could fit within the R framework.

Yes. The other side of the coin is that we do actually use the
TRUE/FALSE == 1/0  convention in places. E.g. (x0)-(x0) for the
sign of x, or x*(x0) for x left-censored at 0. So changing the
current semantics is not really in the cards. Turning xyz  into a
syntax error is on the other hand quite simple (at least according to
5 seconds worth of googling for yacc nonassoc) and we should
probably consider doing so.

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Multiple comparisons: its a trap!

2004-07-20 Thread Barry Rowlingson
Liaw, Andy wrote:
Stupid me: fell into this trap:

0 == 0 == 0
[1] FALSE
 Ouch!
 Python's comparison operators don't have this trap, since they unravel 
each comparison pair in a chain so that:

  (A op1 B op2 C)
becomes:
  (A op1 B) and (B op2 C)
If you want:
 (A op1 B) op2 C
you have to put the parens in, and that makes you remember there's some 
Boolean arithmetic going on in there.

This is a nice feature, since we all are used to reading expressions 
like 2  X  10, and you can write them like that in Python, and they 
mean what they look like.

You can write like that in R, but beware, its not just 0 == 0 == 0 that 
opens the trap:

  X = 5
  10  X  0
 [1] FALSE
  0  X  10
 [1] TRUE
 Of course old hand Fortran programmers understand all this since the 
second thing they learnt (after learning how to tap the space bar six 
times) was the order of precedence of operators...

Baz
PS oh, and in Perl (0 == 0 == 0) is a syntax error!
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Multiple comparisons in R; multicomp

2004-01-16 Thread Sean Davis
Patrick

I'm not familiar with the multcomp package from s-plus, but there is a
package available through bioconductor (www.bioconductor.org) called
multtest that has some functions for multiple testing procedures and
adjusting p-values and computing false discovery rates.

Sean
-- 
Sean Davis, M.D., Ph.D.

Clinical Fellow
National Institutes of Health
National Cancer Institute
National Human Genome Research Institute

Clinical Fellow, Johns Hopkins
Department of Pediatric Oncology
-- 



On 1/15/04 5:03 PM, Patrick Giraudoux [EMAIL PROTECTED]
wrote:

 Is there a fonction for multiple comparison tests (similar to multicomp in
 Splus) in a package of R?
 
 Thanks in advance for any hint...
 
 Cheers, 
 
 Patrick Giraudoux
 
 
 University of Franche-Comte
 Department of Environmental Biology
 EA3184 af. INRA
 F-25030 Besancon Cedex
 
 tel.: +33 381 665 745
 fax.: +33 381 665 797
 http://lbe.univ-fcomte.fr
 
 
 
 [[alternative HTML version deleted]]
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Multiple comparisons in R; multicomp

2004-01-15 Thread Patrick Giraudoux
Is there a fonction for multiple comparison tests (similar to multicomp in Splus) in 
a package of R?

Thanks in advance for any hint...

Cheers, 

Patrick Giraudoux


University of Franche-Comté
Department of Environmental Biology
EA3184 af. INRA
F-25030 Besançon Cedex

tel.: +33 381 665 745
fax.: +33 381 665 797
http://lbe.univ-fcomte.fr



[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Multiple comparisons in R; multicomp

2004-01-15 Thread Andy Bunn
There is now a package in R called multcomp for general multiple
comparisons that does things similar to the Splus library you mentioned.
BTW, a search of the help archives for multicomp or multiple
comparisons brings this up.

HTH, Andy

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Multiple comparisons with a glm

2003-11-05 Thread Ken Knoblauch
I've never seen anything written about multiple comparisons,
as in the multcomp package or with TukeyHSD, but using a glm. 
 Do such procedures exist?  Are they sensible?
Are there any packages in R that implement such comparisons?
Thank you.


-- 
Ken Knoblauch
Inserm U371
Cerveau et Vision
18 avenue du Doyen Lepine
69675 Bron cedex
France
Tel: +33 (0)4 72 91 34 77
Fax: +33 (0)4 72 91 34 61
Portable: 06 84 10 64 10
email: [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Multiple comparisons with a glm

2003-11-05 Thread Achim Zeileis
On Wednesday 05 November 2003 17:28, Ken Knoblauch wrote:

 I've never seen anything written about multiple comparisons,
 as in the multcomp package or with TukeyHSD, but using a glm.
  Do such procedures exist?  Are they sensible?
 Are there any packages in R that implement such comparisons?

simint() and simtest() both have methods for glm objects.

hth,
Z

 Thank you.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Multiple comparisons with a glm

2003-11-05 Thread Torsten Hothorn

 I've never seen anything written about multiple comparisons,
 as in the multcomp package or with TukeyHSD, but using a glm.
  Do such procedures exist?  Are they sensible?
 Are there any packages in R that implement such comparisons?

since version 0.4-0 in `multcomp':

 0.4-0 (13.08.2003)

`simint' and `simtest' now have methods for `lm' and `glm'

But you are right that there is not much theory about it (at least to my
knowledge). The procedures in `multcomp' allow for inference
on parameter estimates which are, asymptotically, multivariate normal
with known correlation structure.

Best,

Torsten


 Thank you.


 --
 Ken Knoblauch
 Inserm U371
 Cerveau et Vision
 18 avenue du Doyen Lepine
 69675 Bron cedex
 France
 Tel: +33 (0)4 72 91 34 77
 Fax: +33 (0)4 72 91 34 61
 Portable: 06 84 10 64 10
 email: [EMAIL PROTECTED]

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help



__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] multiple comparisons

2003-10-07 Thread Peter Adler
I'm having trouble finding an R equivalent to the S-Plus multicomp 
function, which does post-hoc comparisons of treatments means in 
ANOVAs.  Am I missing something obvious?

Thanks, Peter

Peter Adler, PhD
Dept. Ecology, Evolution and Marine Biology
University of California
Santa Barbara, CA 93106
tel: (805) 893-7416
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] multiple comparisons

2003-10-07 Thread Jonathan Baron
On 10/07/03 09:05, Peter Adler wrote:
I'm having trouble finding an R equivalent to the S-Plus multicomp 
function, which does post-hoc comparisons of treatments means in 
ANOVAs.  Am I missing something obvious?

The package called multcomp?  I don't know if it is the same.

-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page:http://www.sas.upenn.edu/~baron
R page:   http://finzi.psych.upenn.edu/

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] multiple comparisons

2003-10-07 Thread Prof Brian Ripley
On Tue, 7 Oct 2003, Jonathan Baron wrote:

 On 10/07/03 09:05, Peter Adler wrote:
 I'm having trouble finding an R equivalent to the S-Plus multicomp 
 function, which does post-hoc comparisons of treatments means in 
 ANOVAs.  Am I missing something obvious?
 
 The package called multcomp?  I don't know if it is the same.

It is not, but can often be used in a different way to get similar
results.  There is also function TukeyHSD() in base R (which is often the 
simplest competitive method).

THe MASS scripts show some of the ways to use these in R to emulate
S-PLUS's multicomp.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help