Re: [R] p adjustment on 4thcorner results

2011-10-12 Thread Cristina Ramalho
Hi Christoph,

Thank you soo much, this is great!

All the very best,

Cristina


On Wed, Oct 12, 2011 at 4:52 PM, Christoph Molnar 
christoph.mol...@googlemail.com wrote:

 Hi,

 the function fourthcorners() returns a list.  You can access the pvalues
 shown in the summary by four1[[tabGProb]]. This is a matrix containing the
 pvalues in the summary.

 I did some copy and paste from the summary.4thcorners() function (which is
 called, by using summary on your four1 object).  And I changed it a little
 bit, so that it doesn't print the summary, but returns you the result as a
 data.frame. So you can access the Pvalues in the same way you are used to.


 summary_fourth - function(object){
 res  - matrix(0, nrow(object$tabG) * ncol(object$tabG), 6)
 res - as.data.frame(res)
 res[, 1] = format(colnames(object$tabG)[col(as.matrix(object$tabG))],
 justify = right)
 res[, 2] = format(rownames(object$tabG)[row(as.matrix(object$tabG))])
 res[, 3] = as.vector(outer(object$indexQ, object$indexR))
 if (!inherits(object, 4thcorner.rlq)) {
 res[res[, 4] == 1, 4] = r
 res[res[, 4] == 2, 4] = F
 res[res[, 4] == 4, 4] = Chi2
 }
 else {
 res[res[, 4] == 1, 4] = r^2
 res[res[, 4] == 2, 4] = Eta^2
 res[res[, 4] == 4, 4] = Chi2/sum(L)
 }
 res[, 4] = as.vector(signif(as.matrix(object$tabG)))
 res[, 5] = as.vector(as.matrix(object$tabGProb))
 signifpval - symnum(as.numeric(res[, 5]), corr = FALSE,
 na = FALSE, cutpoints = c(0, 0.001, 0.01, 0.05, 0.1,
 1), symbols = c(***, **, *, .,  ))
 res[, 6] = signifpval
 colnames(res) = c(Var. R, Var. Q, Stat., Value,
 Prob.,  )
 res
 }

 fourth - summary_fourth(four1)
 p.adjust(fourth$Prob, method=holm)


 Christoph



 2011/10/12 Cristina Ramalho cristina.rama...@grs.uwa.edu.au

 Hi, probably I didnt formulate my question correctly. I know that to aply
 Holm correction I have to do something like:

  woody=read.table(woody.txt, sep=\t, head=T, row.names = 1)
 woodyadj = p.adjust(woody$p, method = holm)

 My question is how to do the correction directly on the results of
 4thcorner? Or, another way, how can I convert the 4th corner results in a
 data matrix where I can run the p.adjust function?

 Thank you so much. Cheers,

 C.

 On Wed, Oct 12, 2011 at 3:20 PM, Christoph Molnar 
 christoph.mol...@googlemail.com wrote:

 Hi,

 ?p.adjust

 Christoph

 2011/10/12 Cristina Ramalho cristina.rama...@grs.uwa.edu.au

  Hi all,

 This is probably a very simple question but I cannot figure out how to
 do
 it. I run the fourthcorner method with my data and would like to adjust
 the
 p values for multiple comparisons using Holm correction. When I run the
 fourthcorner I obtain the results in yellow. What do I need to do to be
 able
 to aply the Holm correction to those p values?

  library(ade4)
  four1 - fourthcorner(tabR, tabL, tabQ, modeltype = 1, nrepet = 999,
 tr01
 = FALSE)
  summary(four1)
 Fourth-corner Statistics
 Permutation method  1  ( 999  permutations)
 ---

  Var. R   Var. QStat. ValueProb.
 RABINT / SPAN   r -0.0478943   0.038 *
 RABINT / TREEr 0   1.000
 RABINT / SHRU   r 0   1.000
 RABINT / HERB   r 0.02618790.340
 RABINT / SEDG   r -0.0320345   0.316
 RABINT / GRAS  r 0.01242630.399

 Thank you in advance for your help,

 Regards,

 C.

 --
 Cristina E. Ramalho
 PhD Candidate
 MSc in GIS

 Ecosystem Restoration  Intervention Ecology Research Group
 School of Plant Biology (M090)
 The University of Western Australia
 35 Stirling Highway, Crawley WA 6009 Perth, Australia
 Phone: +61 (08) 6488 4655; Fax: +61 (08) 6488 7461
 www.plants.uwa.edu.au/research/ecosystem_restoration

 ---

[[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.htmlhttp://www.r-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.





 --
 Cristina E. Ramalho
 PhD Candidate
 MSc in GIS

 Ecosystem Restoration  Intervention Ecology Research Group
 School of Plant Biology (M090)
 The University of Western Australia
 35 Stirling Highway, Crawley WA 6009 Perth, Australia
 Phone: +61 (08) 6488 4655; Fax: +61 (08) 6488 7461
 www.plants.uwa.edu.au/research/ecosystem_restoration

 ---



[[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] p adjustment on 4thcorner results

2011-10-11 Thread Cristina Ramalho
Hi all,

This is probably a very simple question but I cannot figure out how to do
it. I run the fourthcorner method with my data and would like to adjust the
p values for multiple comparisons using Holm correction. When I run the
fourthcorner I obtain the results in yellow. What do I need to do to be able
to aply the Holm correction to those p values?

 library(ade4)
 four1 - fourthcorner(tabR, tabL, tabQ, modeltype = 1, nrepet = 999, tr01
= FALSE)
 summary(four1)
Fourth-corner Statistics
Permutation method  1  ( 999  permutations)
---

  Var. R   Var. QStat. ValueProb.
RABINT / SPAN   r -0.0478943   0.038 *
RABINT / TREEr 0   1.000
RABINT / SHRU   r 0   1.000
RABINT / HERB   r 0.02618790.340
RABINT / SEDG   r -0.0320345   0.316
RABINT / GRAS  r 0.01242630.399

Thank you in advance for your help,

Regards,

C.

-- 
Cristina E. Ramalho
PhD Candidate
MSc in GIS

Ecosystem Restoration  Intervention Ecology Research Group
School of Plant Biology (M090)
The University of Western Australia
35 Stirling Highway, Crawley WA 6009 Perth, Australia
Phone: +61 (08) 6488 4655; Fax: +61 (08) 6488 7461
www.plants.uwa.edu.au/research/ecosystem_restoration
---

[[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] Doubt on using lattice

2010-10-19 Thread Cristina Ramalho
Hi all,

I suppose this is a very simple question, but as I've lost already a bit of
time with it, without being able to get what I wanted, I'm addressing the
question to the group in the hope someone can help me.

I pretend to plot the richness of herbaceous species (RichHN) as a function
of time since remnant isolation (Isol) conditioned to the area of the
remnant (fArea - this is a factor with 3 classes). I also want to
differentiate the sites plotted using a grouping binary variable (Urb).

So far, I've written this:

extinction-xyplot(RichHN~Isol|fArea, data = Data, type = p, groups=Urb,
  aspect=xy, layout=c(3,1), between=list(x=0.5, y=0.5),
  cex=1, pch = c(21, 1),
  auto.key=list(space=bottom),
  main=Influence of time since remnant isolation and remnant area
on species diversity,
  xlab=Time since remnant isolation (rank),
  ylab=Richness of native herbaceous)
print(extinction)

What do I need to add, in order I can have:
- the graph dots labeled with the variable SiteName
- an overall trend line for each panel
- the dots with Urb=1 filled in black; and the dots with Urb=0 filled in
white

I've been back and forwards, trying to use panel function, but I didn't
manage to do it right...

Thank you for your help in advance. Regards,

C.


Cristina Estima Ramalho
PhD Candidate
MSc in GIS

Ecosystem Restoration Lab
School of Plant Biology (M090)
The University of Western Australia
35 Stirling Highway, Crawley WA 6009 Perth, Australia
Phone: +61 (08) 6488 4655; Fax: +61 (08) 6488 7461
www.plants.uwa.edu.au/research/ecosystem_restoration
-

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