[R] ANOVA with replicate measures

2009-06-18 Thread João Fadista
Hi,

I have the following dataset (shown only part of it):

WFPSsampling dayslurry  depth   replicates  N2O (mg/m2/h)
1   1   1   3   1   0.007
1   1   1   3   2   0.022
1   1   1   3   3   0.015
1   1   2   3   1   0.033
1   1   2   3   2   0.010
1   1   2   3   3   0.022
1   1   2   6   1   0.038
1   1   2   6   2   0.048
1   1   2   6   3   0.043
1   1   3   0   1   0.024
1   2   1   3   1   0.017
1   2   1   3   2   0.016
1   2   1   3   3   0.015
1   2   2   3   1   0.047
1   2   2   3   2   0.083
1   2   2   3   3   0.042
1   2   2   6   1   0.036
1   2   2   6   2   0.048
1   2   2   6   3   0.030
1   2   3   0   1   0.020
1   3   1   3   1   0.006
1   3   1   3   2   0.007
1   3   1   3   3   0.019
1   3   2   3   1   0.055
1   3   2   3   2   0.004
1   3   2   3   3   0.025
1   3   2   6   1   0.030
1   3   2   6   2   0.024
1   3   2   6   3   0.042
1   3   3   0   1   0.017


What it is: daily N2O emission rate after the injection of 2 different types of 
slurry into the soil moistened at 2 different levels.
So I want to test all the factors on the N2O emissions:
1) injection depth
2) slurry type
3) water content into the soil (=WFPS)
Bu I want to take into account the replicates. How can I write the R syntax in 
this case? Something like:
 model2-aov(N2O.mg.m2.h. ~ WFPS*sampling_day*slurry*depth + 
Error(replicates/(WFPS + sampling_day + slurry + depth)))



Thanks in advance,
Joao



[[alternative HTML version deleted]]

__
R-help@r-project.org 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] permutation test assumption?

2008-04-08 Thread João Fadista
Dear all,
 
Can I do a permutation test if the number of individuals in one group is much 
bigger than in the other group? I searched the literature but I didin´t find 
any assumption that refers to this subject for permutation tests.
 

Best regards

João Fadista
Ph.d. student



 UNIVERSITY OF AARHUS   
Faculty of Agricultural Sciences
Dept. of Genetics and Biotechnology 
Blichers Allé 20, P.O. BOX 50   
DK-8830 Tjele   

Phone:   +45 8999 1900  
Direct:  +45 8999 1900  
E-mail:  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]   
Web: www.agrsci.org http://www.agrsci.org/


DJF now offers new degree programmes 
http://www.agrsci.org/content/view/full/34133 . 

News and news media http://www.agrsci.org/navigation/nyheder_og_presse .

This email may contain information that is confidential. Any use or publication 
of this email without written permission from Faculty of Agricultural Sciences 
is not allowed. If you are not the intended recipient, please notify Faculty of 
Agricultural Sciences immediately and delete this email.




[[alternative HTML version deleted]]

__
R-help@r-project.org 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] permutation test assumption?

2008-04-08 Thread João Fadista
Dear Thierry,
 
Thanks for the reply. But as you may read in the paper 
http://bioinformatics.oxfordjournals.org/cgi/content/abstract/22/18/2244 when 
the sample sizes are not the same there may be an increase in the Type I error 
rate.
 
Comments will be appreciated.
 
Best regards,
João Fadista
 



De: ONKELINX, Thierry [mailto:[EMAIL PROTECTED]
Enviada: ter 08-04-2008 15:27
Para: João Fadista; r-help@r-project.org
Assunto: RE: [R] permutation test assumption?



Dear João,

You can do permutation tests on an unbalanced design.

HTH,

Thierry



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and 
Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology 
and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
[EMAIL PROTECTED]
www.inbo.be

To call in the statistician after the experiment is done may be no more than 
asking him to perform a post-mortem examination: he may be able to say what the 
experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure 
that a reasonable answer can be extracted from a given body of data.
~ John Tukey

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens João Fadista
Verzonden: dinsdag 8 april 2008 15:18
Aan: r-help@r-project.org
Onderwerp: [R] permutation test assumption?

Dear all,

Can I do a permutation test if the number of individuals in one group is much 
bigger than in the other group? I searched the literature but I didin´t find 
any assumption that refers to this subject for permutation tests.


Best regards

João Fadista
Ph.d. student


   
 UNIVERSITY OF AARHUS  
Faculty of Agricultural Sciences   
Dept. of Genetics and Biotechnology
Blichers Allé 20, P.O. BOX 50  
DK-8830 Tjele  
   
Phone:   +45 8999 1900 
Direct:  +45 8999 1900 
E-mail:  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Web: www.agrsci.org http://www.agrsci.org/   


DJF now offers new degree programmes 
http://www.agrsci.org/content/view/full/34133 .

News and news media http://www.agrsci.org/navigation/nyheder_og_presse .

This email may contain information that is confidential. Any use or publication 
of this email without written permission from Faculty of Agricultural Sciences 
is not allowed. If you are not the intended recipient, please notify Faculty of 
Agricultural Sciences immediately and delete this email.




[[alternative HTML version deleted]]

__
R-help@r-project.org 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] permutation test assumption?

2008-04-08 Thread João Fadista
But in that paper they refer to another 
(http://www.bepress.com/cgi/viewcontent.cgi?article=1053context=ucbbiostat) 
where they say that permutation distribution produces an asymptotically 
correct null distribution if (i) the sample sizes are equal
 
Best regards,
João



De: Achim Zeileis [mailto:[EMAIL PROTECTED]
Enviada: qua 09-04-2008 0:26
Para: João Fadista
Cc: ONKELINX, Thierry; r-help@r-project.org
Assunto: Re: [R] permutation test assumption?



On Wed, 9 Apr 2008, João Fadista wrote:

 Dear Thierry,

 Thanks for the reply. But as you may read in the paper
 http://bioinformatics.oxfordjournals.org/cgi/content/abstract/22/18/2244
 when the sample sizes are not the same there may be an increase in the
 Type I error rate.

No, this is false and not what the reference above says. Please read more
carefully.

 Comments will be appreciated.

The basic assumption for permutation tests is exchangeability of the
observations (regardless of sample sizes). The reference above describes a
situation when this assumption is violated.
Z

 Best regards,
 João Fadista


 

 De: ONKELINX, Thierry [mailto:[EMAIL PROTECTED]
 Enviada: ter 08-04-2008 15:27
 Para: João Fadista; r-help@r-project.org
 Assunto: RE: [R] permutation test assumption?



 Dear João,

 You can do permutation tests on an unbalanced design.

 HTH,

 Thierry


 
 ir. Thierry Onkelinx
 Instituut voor natuur- en bosonderzoek / Research Institute for Nature and 
 Forest
 Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, 
 methodology and quality assurance
 Gaverstraat 4
 9500 Geraardsbergen
 Belgium
 tel. + 32 54/436 185
 [EMAIL PROTECTED]
 www.inbo.be

 To call in the statistician after the experiment is done may be no more than 
 asking him to perform a post-mortem examination: he may be able to say what 
 the experiment died of.
 ~ Sir Ronald Aylmer Fisher

 The plural of anecdote is not data.
 ~ Roger Brinner

 The combination of some data and an aching desire for an answer does not 
 ensure that a reasonable answer can be extracted from a given body of data.
 ~ John Tukey

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens João Fadista
 Verzonden: dinsdag 8 april 2008 15:18
 Aan: r-help@r-project.org
 Onderwerp: [R] permutation test assumption?

 Dear all,

 Can I do a permutation test if the number of individuals in one group is much 
 bigger than in the other group? I searched the literature but I didin´t find 
 any assumption that refers to this subject for permutation tests.


 Best regards

 João Fadista
 Ph.d. student



  UNIVERSITY OF AARHUS
 Faculty of Agricultural Sciences
 Dept. of Genetics and Biotechnology
 Blichers Allé 20, P.O. BOX 50
 DK-8830 Tjele

 Phone:   +45 8999 1900
 Direct:  +45 8999 1900
 E-mail:  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 Web: www.agrsci.org http://www.agrsci.org/
 

 DJF now offers new degree programmes 
 http://www.agrsci.org/content/view/full/34133 .

 News and news media http://www.agrsci.org/navigation/nyheder_og_presse .

 This email may contain information that is confidential. Any use or 
 publication of this email without written permission from Faculty of 
 Agricultural Sciences is not allowed. If you are not the intended recipient, 
 please notify Faculty of Agricultural Sciences immediately and delete this 
 email.




 [[alternative HTML version deleted]]

 __
 R-help@r-project.org 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-help@r-project.org 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] wilcox.test test statistic

2007-10-17 Thread João Fadista
Dear all,
 
When we perform a Wilcoxon rank sum test (on two samples with different sizes) 
we get a test statistic. My question is, as the value of test statistic 
increases the difference between the distributions of the two samples also 
increase, right?
 
Thanks in advance,
João Fadista
 
 
 



[[alternative HTML version deleted]]

__
R-help@r-project.org 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] chisq.test in batch

2007-10-11 Thread João Fadista
Dear all,
 
I would like to compute hundreds of chisq.test ´s, and for each test output I 
would like to extract only the p-values. So my question is: how can I make this 
without making it manually?
 
 
Example:
 
# Test nº1
  chisq.test(c(220,240))
 
Chi-squared test for given probabilities
data:  c(220, 240) 
X-squared = 0.8696, df = 1, p-value = 0.3511
 
# Test nº2
  chisq.test(c(301,258))
Chi-squared test for given probabilities
data:  c(301, 258) 
X-squared = 3.3077, df = 1, p-value = 0.06896
 
...
 
# Test nº200
 chisq.test(c(242,281))
Chi-squared test for given probabilities
data:  c(242, 281) 
X-squared = 2.9082, df = 1, p-value = 0.08813
 
 
Desired output:
Test   1   2 ... 200
p-value   0.3511   0.06896   ... 0.08813
 
 
 
Thanks in advance.
Best regards,
João Fadista
 

 

 

__
R-help@r-project.org 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] subsetting a data.frame

2007-10-10 Thread João Fadista
Dear all,
 
I would like to be able to subset a data.frame in a special way. I will put 
here an example:
 
Score Name
88   19_0070
88   19_0070  
87   19_0070  
79   002127_0658  
79   002127_0658   
77   002127_0658
 
So, for the above example I would like to have a new data.frame that has only 
the best Score for each Name:  
 
Score Name
88   19_0070
88   19_0070  
79   002127_0658   
79   002127_0658   
 
 
 
Thanks in advance.
Best regards,
João Fadista
 
 
 




[[alternative HTML version deleted]]

__
R-help@r-project.org 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] read only certain parts of a file

2007-10-09 Thread João Fadista
Dear all,
 
I would like to know how can I read a text file and create a data frame of only 
certain parts of the file.
For instance, from this text file:
 
===

Matches For Query 0 (108 bases): 19_0070

===

Score Q_Name S_Name Q_Start Q_End S_Start S_End Direction Bases identity

89 19_0070 Chr15 3 108 43251883 43251778 C 106 95.28 

88 19_0070 Chr1 4 108 85826948 85826844 C 105 95.24 

===

Matches For Query 1 (124 bases): 24_1262

===

Score Q_Name S_Name Q_Start Q_End S_Start S_End Direction Bases identity

99 24_1262 Chr6 16 124 35738256 35738364 F 109 100.00 

 

I would like to have a data frame that has only:

Score Q_Name S_Name Q_Start Q_End S_Start S_End Direction Bases identity

89 19_0070 Chr15 3 108 43251883 43251778 C 106 95.28 

88 19_0070 Chr1 4 108 85826948 85826844 C 105 95.24 

99 24_1262 Chr6 16 124 35738256 35738364 F 109 100.00 

 
 
Best regards,
João Fadista

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Barnard's exact test

2007-09-28 Thread João Fadista
Dear all,
 
I would like to know if there is any R package that has the Barnard´s exact 
test. I also like to have any opinions about which test is more powerful: 
Fisher´s exact test or Barnard´s exact test. 

 
Best regards

João Fadista
Ph.d. student



 UNIVERSITY OF AARHUS   
Faculty of Agricultural Sciences
Dept. of Genetics and Biotechnology 
Blichers Allé 20, P.O. BOX 50   
DK-8830 Tjele   

Phone:   +45 8999 1900  
Direct:  +45 8999 1900  
E-mail:  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]   
Web: www.agrsci.org http://www.agrsci.org/


News and news media http://www.agrsci.org/navigation/nyheder_og_presse .

This email may contain information that is confidential. Any use or publication 
of this email without written permission from Faculty of Agricultural Sciences 
is not allowed. If you are not the intended recipient, please notify Faculty of 
Agricultural Sciences immediately and delete this email.


[[alternative HTML version deleted]]

__
R-help@r-project.org 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.