Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives
Thank you all very much for the comments! They are so helpful. Yes, I do only have 8 species, and 3 replicates each. It is not ideal, but it's what we have and we have a phylogeny, so I'd like to try some tests incorporating phylogeny. I probably should have added that I plan on running OLS to test each regression without the tree. This should give me an idea of the general relationship. Regarding Liam's comment in pgls.Ives: Is the lower=c(1e-8,1e-8) call of the pgls.Ives call the part where it constrains the slope to (almost)zero? I'll definitely give the MERegPHYSIGv2.m method a try as well, with Tony's diagnostic suggestions. I will also go the LRT route with the data. Thanks very much again for your help! Andrea ~~ Andrea Berardi, PhD Postdoctoral Researcher, Smith Lab EBIO, University of Colorado-Boulder andrea.bera...@colorado.edu On Mar 1, 2015, at 8:42 PM, Liam J. Revell liam.rev...@umb.edu wrote: Hi Andrea. This is not presently implemented, but since this is a likelihood method it would be straightforward to constrain to a slope of zero and then do a LR test. This would be probably be the easiest way to test a hypothesis about the regression. That being said, as noted in the function documentation, some problems have been reported with the optimization algorithm for this model, which is simple and thus may fail to find the ML solution. Consequently, I would encourage you to look for other implementations of the method so that you can be confident in your result. I'm not aware of one in R at this time. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 3/1/2015 10:31 PM, Andrea Berardi wrote: Hi all, I'm just learning how to do PGLS analyses, and I'm looking for advice on how to evaluate the significance of the regression fit using pgls.Ives in the phytools package. I'm using this function because it incorporates sampling error of species means, and my data has about 3 individuals per species, with 8 species. My goal is to test whether a flower trait predicts the leaf trait, while controlling for shared ancestry. Here is the output from pgls.Ives: fit - pgls.Ives(Tree, Flower_trait, Leaf_trait) fit $beta [1] 96.3963098 0.1292656 $sig2x [1] 22218901073 $sig2y [1] 23027587 $a [1] -10063.150 -1204.422 $logL [1] -158.2337 $convergence [1] 0 $message [1] CONVERGENCE: REL_REDUCTION_OF_F = FACTR*EPSMCH I am also running pgls on species averages for the traits using the gls function in nlme and the corBrownian and corMartins functions in ape. But, we are interested in incorporating the within-species variation in our small dataset. Any suggestions would be welcome! Thanks for your help, Andrea ~~ Andrea Berardi, PhD Postdoctoral Researcher, Smith Lab EBIO, University of Colorado-Boulder ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives
Andrea, remember that you can and should also do the OLS models (i.e., assuming a star phylogeny) with measurement error considered. That's in the programs that accompany Ives, Midford, and Garland (2007, Syst. Biol. 56:252–270), and were in the batch I just sent you. Cheers, Ted Theodore Garland, Jr., Professor Department of Biology University of California, Riverside Riverside, CA 92521 Office Phone: (951) 827-3524 Facsimile: (951) 827-4286 (not confidential) Email: tgarl...@ucr.edu http://www.biology.ucr.edu/people/faculty/Garland.html http://scholar.google.com/citations?hl=enuser=iSSbrhwJ Director, UCR Institute for the Development of Educational Applications Editor in Chief, Physiological and Biochemical Zoology Fail Lab: Episode One http://testtube.com/faillab/zoochosis-episode-one-evolution http://www.youtube.com/watch?v=c0msBWyTzU0 From: R-sig-phylo [r-sig-phylo-boun...@r-project.org] on behalf of Andrea Berardi [andrea.bera...@colorado.edu] Sent: Monday, March 02, 2015 3:57 PM To: r-sig-phylo@r-project.org Cc: Anthony R Ives; Peter Smits Subject: Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives Thank you all very much for the comments! They are so helpful. Yes, I do only have 8 species, and 3 replicates each. It is not ideal, but it's what we have and we have a phylogeny, so I'd like to try some tests incorporating phylogeny. I probably should have added that I plan on running OLS to test each regression without the tree. This should give me an idea of the general relationship. Regarding Liam's comment in pgls.Ives: Is the lower=c(1e-8,1e-8) call of the pgls.Ives call the part where it constrains the slope to (almost)zero? I'll definitely give the MERegPHYSIGv2.m method a try as well, with Tony's diagnostic suggestions. I will also go the LRT route with the data. Thanks very much again for your help! Andrea ~~ Andrea Berardi, PhD Postdoctoral Researcher, Smith Lab EBIO, University of Colorado-Boulder andrea.bera...@colorado.edu On Mar 1, 2015, at 8:42 PM, Liam J. Revell liam.rev...@umb.edu wrote: Hi Andrea. This is not presently implemented, but since this is a likelihood method it would be straightforward to constrain to a slope of zero and then do a LR test. This would be probably be the easiest way to test a hypothesis about the regression. That being said, as noted in the function documentation, some problems have been reported with the optimization algorithm for this model, which is simple and thus may fail to find the ML solution. Consequently, I would encourage you to look for other implementations of the method so that you can be confident in your result. I'm not aware of one in R at this time. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 3/1/2015 10:31 PM, Andrea Berardi wrote: Hi all, I'm just learning how to do PGLS analyses, and I'm looking for advice on how to evaluate the significance of the regression fit using pgls.Ives in the phytools package. I'm using this function because it incorporates sampling error of species means, and my data has about 3 individuals per species, with 8 species. My goal is to test whether a flower trait predicts the leaf trait, while controlling for shared ancestry. Here is the output from pgls.Ives: fit - pgls.Ives(Tree, Flower_trait, Leaf_trait) fit $beta [1] 96.3963098 0.1292656 $sig2x [1] 22218901073 $sig2y [1] 23027587 $a [1] -10063.150 -1204.422 $logL [1] -158.2337 $convergence [1] 0 $message [1] CONVERGENCE: REL_REDUCTION_OF_F = FACTR*EPSMCH I am also running pgls on species averages for the traits using the gls function in nlme and the corBrownian and corMartins functions in ape. But, we are interested in incorporating the within-species variation in our small dataset. Any suggestions would be welcome! Thanks for your help, Andrea ~~ Andrea Berardi, PhD Postdoctoral Researcher, Smith Lab EBIO, University of Colorado-Boulder ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives
Simon and Ben, Of course, sample size of 8 is going to be an issue in almost any analysis. But sometimes that is all the data there are. Incidentally, this exchange reminded me that I’m still wary of making comments on r-sig. If somebody comes into my office, I have the time to discuss with them their data, so I can learn more about it. Then I feel I can at least make informed recommendations for analyses — they might still be badly wrong recommendations, but at least they are informed. I’m still uncomfortable about making suggestions on r-sig, when I don’t really have full information, or the time to think. Therefore, the few comments I’ve made have been very general about methods, rather than specific about data sets. I think this is just a matter of me waking up to the 21st century. I do like the idea of crowdsourcing; I just need to get comfortable with it. Cheers, Tony Anthony Ives Department of Zoology 459 Birge Hall (4th floor, E end of bldg) UW-Madison Madison, WI 53706 608-262-1519 On Mar 1, 2015, at 10:53 PM, Simon Blomberg s.blombe...@uq.edu.au wrote: Hi Ben, Yes, you would have to assume constant variance across species to use N=24. I think that is the only option. But given that biological data often has a positive mean-variance relationship, again I'm dubious about the exercise. YMMV, however! Cheers, Simon. Simon Blomberg, BSc (Hons), PhD, MAppStat, AStat. Senior Lecturer and Consultant Statistician School of Biological Sciences The University of Queensland St. Lucia Queensland 4072 Australia T: +61 7 3365 2506 email: S.Blomberg1_at_uq.edu.au http://www.evolutionarystatistics.org Policies: 1. I will NOT analyse your data for you. 2. Your deadline is your problem Basically, I'm not interested in doing research and I never have been. I'm interested in understanding, which is quite a different thing. - David Blackwell From: R-sig-phylo [r-sig-phylo-boun...@r-project.org] on behalf of Ben Bolker [bbol...@gmail.com] Sent: Monday, March 02, 2015 2:49 PM To: r-sig-phylo@r-project.org Subject: Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 15-03-01 11:40 PM, Simon Blomberg wrote: Am I missing something? The OP only has 8 species in the data set. I wouldn't put much store in fancy PCM modelling based on such a small data set. And 3 individuals per species is not enough for a good estimate of the within-species variance. Simon. Agree wholeheartedly with the first point -- but for the second, isn't 24 rather than 8 the relevant number for estimating within-species variance (since presumably we are assuming the same variance within every species, thus we can effectively pool within-species variation \across species for this purpose) ? Simon Blomberg, BSc (Hons), PhD, MAppStat, AStat. Senior Lecturer and Consultant Statistician School of Biological Sciences The University of Queensland St. Lucia Queensland 4072 Australia T: +61 7 3365 2506 email: S.Blomberg1_at_uq.edu.au http://www.evolutionarystatistics.org Policies: 1. I will NOT analyse your data for you. 2. Your deadline is your problem Basically, I'm not interested in doing research and I never have been. I'm interested in understanding, which is quite a different thing. - David Blackwell From: R-sig-phylo [r-sig-phylo-boun...@r-project.org] on behalf of Anthony R Ives [ari...@wisc.edu] Sent: Monday, March 02, 2015 2:14 PM To: Andrea Berardi Cc: r-sig-phylo@r-project.org Subject: Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives Andrea, I second Liam’s recommendation to use a LRT. For measurement error, the latest code I have in matlab is MERegPHYSIGv2.m, which does both measurement error and an OU or Pagel-lambda transform (see Johnson, M. T. J., A. R. Ives, J. Ahern, and J. P. Salminen. 2014. Macroevolution of plant defenses against herbivores in the evening primroses. New Phytologist 203:267-279). Measurement-error models are always going to have difficulties at parameter boundaries; for example, if the assumed measurement error is large, it can exceed the observed variation in the data, which of course causes problems (statistical and logical). In MERegPHYSIGv2.m, I did a round or two of simulated annealing first, before polishing the results with a Nelder-Mead optimizer. It seems like you could do the same with Liam’s code pretty easily by changing the method of optimization (using edit()). Before doing this, thought, I would take a careful look at your data and your estimates of measurement error. An easy diagnostic is to start with 10% of your estimated measurement standard errors and then increase slowly to 100%. When I have done this, I’ve been able to see problems when parameter values go awry. It is not a fail-safe
Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives
Am I missing something? The OP only has 8 species in the data set. I wouldn't put much store in fancy PCM modelling based on such a small data set. And 3 individuals per species is not enough for a good estimate of the within-species variance. Simon. Simon Blomberg, BSc (Hons), PhD, MAppStat, AStat. Senior Lecturer and Consultant Statistician School of Biological Sciences The University of Queensland St. Lucia Queensland 4072 Australia T: +61 7 3365 2506 email: S.Blomberg1_at_uq.edu.au http://www.evolutionarystatistics.org Policies: 1. I will NOT analyse your data for you. 2. Your deadline is your problem Basically, I'm not interested in doing research and I never have been. I'm interested in understanding, which is quite a different thing. - David Blackwell From: R-sig-phylo [r-sig-phylo-boun...@r-project.org] on behalf of Anthony R Ives [ari...@wisc.edu] Sent: Monday, March 02, 2015 2:14 PM To: Andrea Berardi Cc: r-sig-phylo@r-project.org Subject: Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives Andrea, I second Liam’s recommendation to use a LRT. For measurement error, the latest code I have in matlab is MERegPHYSIGv2.m, which does both measurement error and an OU or Pagel-lambda transform (see Johnson, M. T. J., A. R. Ives, J. Ahern, and J. P. Salminen. 2014. Macroevolution of plant defenses against herbivores in the evening primroses. New Phytologist 203:267-279). Measurement-error models are always going to have difficulties at parameter boundaries; for example, if the assumed measurement error is large, it can exceed the observed variation in the data, which of course causes problems (statistical and logical). In MERegPHYSIGv2.m, I did a round or two of simulated annealing first, before polishing the results with a Nelder-Mead optimizer. It seems like you could do the same with Liam’s code pretty easily by changing the method of optimization (using edit()). Before doing this, thought, I would take a careful look at your data and your estimates of measurement error. An easy diagnostic is to start with 10% of your estimated measurement standard errors and then increase slowly to 100%. When I have done this, I’ve been able to see problems when parameter values go awry. It is not a fail-safe diagnostic in any way, but it can help. Cheers, Tony Anthony Ragnar Ives Department of Zoology UW-Madison Madison, WI 53706 608-262-1519 On Mar 1, 2015, at 9:42 PM, Liam J. Revell liam.rev...@umb.edu wrote: Hi Andrea. This is not presently implemented, but since this is a likelihood method it would be straightforward to constrain to a slope of zero and then do a LR test. This would be probably be the easiest way to test a hypothesis about the regression. That being said, as noted in the function documentation, some problems have been reported with the optimization algorithm for this model, which is simple and thus may fail to find the ML solution. Consequently, I would encourage you to look for other implementations of the method so that you can be confident in your result. I'm not aware of one in R at this time. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 3/1/2015 10:31 PM, Andrea Berardi wrote: Hi all, I'm just learning how to do PGLS analyses, and I'm looking for advice on how to evaluate the significance of the regression fit using pgls.Ives in the phytools package. I'm using this function because it incorporates sampling error of species means, and my data has about 3 individuals per species, with 8 species. My goal is to test whether a flower trait predicts the leaf trait, while controlling for shared ancestry. Here is the output from pgls.Ives: fit - pgls.Ives(Tree, Flower_trait, Leaf_trait) fit $beta [1] 96.3963098 0.1292656 $sig2x [1] 22218901073 $sig2y [1] 23027587 $a [1] -10063.150 -1204.422 $logL [1] -158.2337 $convergence [1] 0 $message [1] CONVERGENCE: REL_REDUCTION_OF_F = FACTR*EPSMCH I am also running pgls on species averages for the traits using the gls function in nlme and the corBrownian and corMartins functions in ape. But, we are interested in incorporating the within-species variation in our small dataset. Any suggestions would be welcome! Thanks for your help, Andrea ~~ Andrea Berardi, PhD Postdoctoral Researcher, Smith Lab EBIO, University of Colorado-Boulder ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable
Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 15-03-01 11:40 PM, Simon Blomberg wrote: Am I missing something? The OP only has 8 species in the data set. I wouldn't put much store in fancy PCM modelling based on such a small data set. And 3 individuals per species is not enough for a good estimate of the within-species variance. Simon. Agree wholeheartedly with the first point -- but for the second, isn't 24 rather than 8 the relevant number for estimating within-species variance (since presumably we are assuming the same variance within every species, thus we can effectively pool within-species variation \across species for this purpose) ? Simon Blomberg, BSc (Hons), PhD, MAppStat, AStat. Senior Lecturer and Consultant Statistician School of Biological Sciences The University of Queensland St. Lucia Queensland 4072 Australia T: +61 7 3365 2506 email: S.Blomberg1_at_uq.edu.au http://www.evolutionarystatistics.org Policies: 1. I will NOT analyse your data for you. 2. Your deadline is your problem Basically, I'm not interested in doing research and I never have been. I'm interested in understanding, which is quite a different thing. - David Blackwell From: R-sig-phylo [r-sig-phylo-boun...@r-project.org] on behalf of Anthony R Ives [ari...@wisc.edu] Sent: Monday, March 02, 2015 2:14 PM To: Andrea Berardi Cc: r-sig-phylo@r-project.org Subject: Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives Andrea, I second Liam’s recommendation to use a LRT. For measurement error, the latest code I have in matlab is MERegPHYSIGv2.m, which does both measurement error and an OU or Pagel-lambda transform (see Johnson, M. T. J., A. R. Ives, J. Ahern, and J. P. Salminen. 2014. Macroevolution of plant defenses against herbivores in the evening primroses. New Phytologist 203:267-279). Measurement-error models are always going to have difficulties at parameter boundaries; for example, if the assumed measurement error is large, it can exceed the observed variation in the data, which of course causes problems (statistical and logical). In MERegPHYSIGv2.m, I did a round or two of simulated annealing first, before polishing the results with a Nelder-Mead optimizer. It seems like you could do the same with Liam’s code pretty easily by changing the method of optimization (using edit()). Before doing this, thought, I would take a careful look at your data and your estimates of measurement error. An easy diagnostic is to start with 10% of your estimated measurement standard errors and then increase slowly to 100%. When I have done this, I’ve been able to see problems when parameter values go awry. It is not a fail-safe diagnostic in any way, but it can help. Cheers, Tony Anthony Ragnar Ives Department of Zoology UW-Madison Madison, WI 53706 608-262-1519 On Mar 1, 2015, at 9:42 PM, Liam J. Revell liam.rev...@umb.edu wrote: Hi Andrea. This is not presently implemented, but since this is a likelihood method it would be straightforward to constrain to a slope of zero and then do a LR test. This would be probably be the easiest way to test a hypothesis about the regression. That being said, as noted in the function documentation, some problems have been reported with the optimization algorithm for this model, which is simple and thus may fail to find the ML solution. Consequently, I would encourage you to look for other implementations of the method so that you can be confident in your result. I'm not aware of one in R at this time. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 3/1/2015 10:31 PM, Andrea Berardi wrote: Hi all, I'm just learning how to do PGLS analyses, and I'm looking for advice on how to evaluate the significance of the regression fit using pgls.Ives in the phytools package. I'm using this function because it incorporates sampling error of species means, and my data has about 3 individuals per species, with 8 species. My goal is to test whether a flower trait predicts the leaf trait, while controlling for shared ancestry. Here is the output from pgls.Ives: fit - pgls.Ives(Tree, Flower_trait, Leaf_trait) fit $beta [1] 96.3963098 0.1292656 $sig2x [1] 22218901073 $sig2y [1] 23027587 $a [1] -10063.150 -1204.422 $logL [1] -158.2337 $convergence [1] 0 $message [1] CONVERGENCE: REL_REDUCTION_OF_F = FACTR*EPSMCH I am also running pgls on species averages for the traits using the gls function in nlme and the corBrownian and corMartins functions in ape. But, we are interested in incorporating the within-species variation in our small dataset. Any suggestions would be welcome! Thanks for your help, Andrea ~~ Andrea Berardi, PhD Postdoctoral
Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives
Hi Ben, Yes, you would have to assume constant variance across species to use N=24. I think that is the only option. But given that biological data often has a positive mean-variance relationship, again I'm dubious about the exercise. YMMV, however! Cheers, Simon. Simon Blomberg, BSc (Hons), PhD, MAppStat, AStat. Senior Lecturer and Consultant Statistician School of Biological Sciences The University of Queensland St. Lucia Queensland 4072 Australia T: +61 7 3365 2506 email: S.Blomberg1_at_uq.edu.au http://www.evolutionarystatistics.org Policies: 1. I will NOT analyse your data for you. 2. Your deadline is your problem Basically, I'm not interested in doing research and I never have been. I'm interested in understanding, which is quite a different thing. - David Blackwell From: R-sig-phylo [r-sig-phylo-boun...@r-project.org] on behalf of Ben Bolker [bbol...@gmail.com] Sent: Monday, March 02, 2015 2:49 PM To: r-sig-phylo@r-project.org Subject: Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 15-03-01 11:40 PM, Simon Blomberg wrote: Am I missing something? The OP only has 8 species in the data set. I wouldn't put much store in fancy PCM modelling based on such a small data set. And 3 individuals per species is not enough for a good estimate of the within-species variance. Simon. Agree wholeheartedly with the first point -- but for the second, isn't 24 rather than 8 the relevant number for estimating within-species variance (since presumably we are assuming the same variance within every species, thus we can effectively pool within-species variation \across species for this purpose) ? Simon Blomberg, BSc (Hons), PhD, MAppStat, AStat. Senior Lecturer and Consultant Statistician School of Biological Sciences The University of Queensland St. Lucia Queensland 4072 Australia T: +61 7 3365 2506 email: S.Blomberg1_at_uq.edu.au http://www.evolutionarystatistics.org Policies: 1. I will NOT analyse your data for you. 2. Your deadline is your problem Basically, I'm not interested in doing research and I never have been. I'm interested in understanding, which is quite a different thing. - David Blackwell From: R-sig-phylo [r-sig-phylo-boun...@r-project.org] on behalf of Anthony R Ives [ari...@wisc.edu] Sent: Monday, March 02, 2015 2:14 PM To: Andrea Berardi Cc: r-sig-phylo@r-project.org Subject: Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives Andrea, I second Liam’s recommendation to use a LRT. For measurement error, the latest code I have in matlab is MERegPHYSIGv2.m, which does both measurement error and an OU or Pagel-lambda transform (see Johnson, M. T. J., A. R. Ives, J. Ahern, and J. P. Salminen. 2014. Macroevolution of plant defenses against herbivores in the evening primroses. New Phytologist 203:267-279). Measurement-error models are always going to have difficulties at parameter boundaries; for example, if the assumed measurement error is large, it can exceed the observed variation in the data, which of course causes problems (statistical and logical). In MERegPHYSIGv2.m, I did a round or two of simulated annealing first, before polishing the results with a Nelder-Mead optimizer. It seems like you could do the same with Liam’s code pretty easily by changing the method of optimization (using edit()). Before doing this, thought, I would take a careful look at your data and your estimates of measurement error. An easy diagnostic is to start with 10% of your estimated measurement standard errors and then increase slowly to 100%. When I have done this, I’ve been able to see problems when parameter values go awry. It is not a fail-safe diagnostic in any way, but it can help. Cheers, Tony Anthony Ragnar Ives Department of Zoology UW-Madison Madison, WI 53706 608-262-1519 On Mar 1, 2015, at 9:42 PM, Liam J. Revell liam.rev...@umb.edu wrote: Hi Andrea. This is not presently implemented, but since this is a likelihood method it would be straightforward to constrain to a slope of zero and then do a LR test. This would be probably be the easiest way to test a hypothesis about the regression. That being said, as noted in the function documentation, some problems have been reported with the optimization algorithm for this model, which is simple and thus may fail to find the ML solution. Consequently, I would encourage you to look for other implementations of the method so that you can be confident in your result. I'm not aware of one in R at this time. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 3/1/2015 10:31 PM, Andrea Berardi wrote: Hi all, I'm just learning how to do PGLS analyses, and I'm
[R-sig-phylo] phytools - evaluating significance of pgls.Ives
Hi all, I'm just learning how to do PGLS analyses, and I'm looking for advice on how to evaluate the significance of the regression fit using pgls.Ives in the phytools package. I'm using this function because it incorporates sampling error of species means, and my data has about 3 individuals per species, with 8 species. My goal is to test whether a flower trait predicts the leaf trait, while controlling for shared ancestry. Here is the output from pgls.Ives: fit - pgls.Ives(Tree, Flower_trait, Leaf_trait) fit $beta [1] 96.3963098 0.1292656 $sig2x [1] 22218901073 $sig2y [1] 23027587 $a [1] -10063.150 -1204.422 $logL [1] -158.2337 $convergence [1] 0 $message [1] CONVERGENCE: REL_REDUCTION_OF_F = FACTR*EPSMCH I am also running pgls on species averages for the traits using the gls function in nlme and the corBrownian and corMartins functions in ape. But, we are interested in incorporating the within-species variation in our small dataset. Any suggestions would be welcome! Thanks for your help, Andrea ~~ Andrea Berardi, PhD Postdoctoral Researcher, Smith Lab EBIO, University of Colorado-Boulder ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives
Hi Andrea. This is not presently implemented, but since this is a likelihood method it would be straightforward to constrain to a slope of zero and then do a LR test. This would be probably be the easiest way to test a hypothesis about the regression. That being said, as noted in the function documentation, some problems have been reported with the optimization algorithm for this model, which is simple and thus may fail to find the ML solution. Consequently, I would encourage you to look for other implementations of the method so that you can be confident in your result. I'm not aware of one in R at this time. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 3/1/2015 10:31 PM, Andrea Berardi wrote: Hi all, I'm just learning how to do PGLS analyses, and I'm looking for advice on how to evaluate the significance of the regression fit using pgls.Ives in the phytools package. I'm using this function because it incorporates sampling error of species means, and my data has about 3 individuals per species, with 8 species. My goal is to test whether a flower trait predicts the leaf trait, while controlling for shared ancestry. Here is the output from pgls.Ives: fit - pgls.Ives(Tree, Flower_trait, Leaf_trait) fit $beta [1] 96.3963098 0.1292656 $sig2x [1] 22218901073 $sig2y [1] 23027587 $a [1] -10063.150 -1204.422 $logL [1] -158.2337 $convergence [1] 0 $message [1] CONVERGENCE: REL_REDUCTION_OF_F = FACTR*EPSMCH I am also running pgls on species averages for the traits using the gls function in nlme and the corBrownian and corMartins functions in ape. But, we are interested in incorporating the within-species variation in our small dataset. Any suggestions would be welcome! Thanks for your help, Andrea ~~ Andrea Berardi, PhD Postdoctoral Researcher, Smith Lab EBIO, University of Colorado-Boulder ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] phytools - evaluating significance of pgls.Ives
Andrea, I second Liam’s recommendation to use a LRT. For measurement error, the latest code I have in matlab is MERegPHYSIGv2.m, which does both measurement error and an OU or Pagel-lambda transform (see Johnson, M. T. J., A. R. Ives, J. Ahern, and J. P. Salminen. 2014. Macroevolution of plant defenses against herbivores in the evening primroses. New Phytologist 203:267-279). Measurement-error models are always going to have difficulties at parameter boundaries; for example, if the assumed measurement error is large, it can exceed the observed variation in the data, which of course causes problems (statistical and logical). In MERegPHYSIGv2.m, I did a round or two of simulated annealing first, before polishing the results with a Nelder-Mead optimizer. It seems like you could do the same with Liam’s code pretty easily by changing the method of optimization (using edit()). Before doing this, thought, I would take a careful look at your data and your estimates of measurement error. An easy diagnostic is to start with 10% of your estimated measurement standard errors and then increase slowly to 100%. When I have done this, I’ve been able to see problems when parameter values go awry. It is not a fail-safe diagnostic in any way, but it can help. Cheers, Tony Anthony Ragnar Ives Department of Zoology UW-Madison Madison, WI 53706 608-262-1519 On Mar 1, 2015, at 9:42 PM, Liam J. Revell liam.rev...@umb.edu wrote: Hi Andrea. This is not presently implemented, but since this is a likelihood method it would be straightforward to constrain to a slope of zero and then do a LR test. This would be probably be the easiest way to test a hypothesis about the regression. That being said, as noted in the function documentation, some problems have been reported with the optimization algorithm for this model, which is simple and thus may fail to find the ML solution. Consequently, I would encourage you to look for other implementations of the method so that you can be confident in your result. I'm not aware of one in R at this time. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 3/1/2015 10:31 PM, Andrea Berardi wrote: Hi all, I'm just learning how to do PGLS analyses, and I'm looking for advice on how to evaluate the significance of the regression fit using pgls.Ives in the phytools package. I'm using this function because it incorporates sampling error of species means, and my data has about 3 individuals per species, with 8 species. My goal is to test whether a flower trait predicts the leaf trait, while controlling for shared ancestry. Here is the output from pgls.Ives: fit - pgls.Ives(Tree, Flower_trait, Leaf_trait) fit $beta [1] 96.3963098 0.1292656 $sig2x [1] 22218901073 $sig2y [1] 23027587 $a [1] -10063.150 -1204.422 $logL [1] -158.2337 $convergence [1] 0 $message [1] CONVERGENCE: REL_REDUCTION_OF_F = FACTR*EPSMCH I am also running pgls on species averages for the traits using the gls function in nlme and the corBrownian and corMartins functions in ape. But, we are interested in incorporating the within-species variation in our small dataset. Any suggestions would be welcome! Thanks for your help, Andrea ~~ Andrea Berardi, PhD Postdoctoral Researcher, Smith Lab EBIO, University of Colorado-Boulder ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/