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.molnar@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.ramalho@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.molnar@googlemail.com> wrote:
>>
>>> Hi,
>>>
>>> ?p.adjust
>>>
>>> Christoph
>>>
>>> 2011/10/12 Cristina Ramalho <cristina.ramalho@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.     Q    Stat. Value        Prob.
>>>> RABINT / SPAN   r     -0.0478943   0.038 *
>>>> RABINT / TREE    r     0                   1.000
>>>> RABINT / SHRU   r     0                   1.000
>>>> RABINT / HERB   r     0.0261879    0.340
>>>> RABINT / SEDG   r     -0.0320345   0.316
>>>> RABINT / GRAS  r     0.0124263    0.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<http://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]]

