tag:blogger.com,1999:blog-8499895524521663926.post1592189412995648452..comments2019-09-19T00:31:54.140-04:00Comments on Phylogenetic Tools for Comparative Biology: Fitting the λ model in phylogenetic regressions using various functionsLiam Revellhttp://www.blogger.com/profile/04314686830842384151noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-8499895524521663926.post-68672519167364019352018-11-16T09:10:36.853-05:002018-11-16T09:10:36.853-05:00
Hi Liu,
In the list R-sig-phylo, I was encourag...<br />Hi Liu, <br /><br />In the list R-sig-phylo, I was encouraged to try Bayesian mixed modeling using the r packages brms and MCMCglmm. But I am still learning on how to use it and could not solve my problem...<br /><br />Hope you get better luck. <br /><br />Cheers, <br />NicolayNicolay Cunhahttps://www.blogger.com/profile/15358623909532265189noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-65036532648778120632018-11-16T09:10:07.014-05:002018-11-16T09:10:07.014-05:00This comment has been removed by the author.Nicolay Cunhahttps://www.blogger.com/profile/15358623909532265189noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-23233426417711169112018-11-16T05:03:10.378-05:002018-11-16T05:03:10.378-05:00Hi Nicolay,
I met the same problem that multple o...Hi Nicolay,<br /><br />I met the same problem that multple observations per species are in my data. Did you fix the problems? If so, could you please share the solution?<br /><br />best <br />LiuUnknownhttps://www.blogger.com/profile/02315323219458495251noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-66349004975835266282018-07-31T11:23:04.508-04:002018-07-31T11:23:04.508-04:00Dear Liam,
Many thanks for the package and blog,...Dear Liam, <br /><br />Many thanks for the package and blog, certainly a great contribution to the field.<br /><br />I would like to test a linear model between a predictor variable (for instance altitude) and a dependent variable (number of flowers). For this, I do have several observations of individuals of 42 species along the predictor variable, but the number of observations do vary per each species and class of the independent variable. In the end, I do have 364 observations unbalanced per each of the 42 species and environment.<br /><br /><br />My intention is doing a model having the number of flower as dependent variable, the temperature as fixed effect, using species as a random factor and add a phylogenetic correction. <br /><br />I could do part of this this following your example with GLS, but the fact of having multiple observations per species do not allow running the model and returns the following message:<br />“number of observations and number of tips in the tree are not equal.”<br /><br />I would much appreciate if you could guide me on how to overcome this issue and run such model.<br /><br />Many thanks,<br />Nicolay<br />Nicolay Cunhahttps://www.blogger.com/profile/15358623909532265189noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-34523373351888286782017-09-18T03:46:48.522-04:002017-09-18T03:46:48.522-04:00I'd like to second this + would be extremely u...I'd like to second this + would be extremely useful!Julie van der Hoophttps://www.blogger.com/profile/14823288789647641350noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-61470729469702296582016-11-21T10:43:43.444-05:002016-11-21T10:43:43.444-05:00Dear Liam!
I would like to obtain confidence nter...Dear Liam!<br /><br />I would like to obtain confidence ntervals for the parameters from pgls model. I do not mean confidence intervals for lambda, but for intercept and slope, but phylogenetically corrected. I tried to use basic R functions like confint, but it did not work. Maybe you know how to do it?<br /><br />Best,<br /><br />AndrzejJyndrekhttps://www.blogger.com/profile/13107902633713630639noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-19491517576187840762014-04-17T21:26:33.118-04:002014-04-17T21:26:33.118-04:00Hi Melissah.
I'm not sure, as I don't mai...Hi Melissah.<br /><br />I'm not sure, as I don't maintain gls (in nlme) or corPagel (in ape); consequently, I'm not familiar with the error message your referring to. You should try posting this question to the R-SIG-phylo email list.<br /><br />All the best, LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-64601464716765955482014-04-11T05:38:38.252-04:002014-04-11T05:38:38.252-04:00Dear Liam,
I am attempting to perform a multiple ...Dear Liam,<br /><br />I am attempting to perform a multiple phylogenetic regression using nlme and ape with the following command style <br /><br />fit<-gls(var1~var2+var3,X,correlation=corPagel(1,tree, fixed=FALSE),method="ML")<br /><br />I have 3 continuous and 3 categorical variables in my specific dataset. When I try to run this analysis with my data using the above approach, I get the following error<br /><br />Error in corFactor.corStruct(object) : <br /> NA/NaN/Inf in foreign function call (arg 1)<br /><br />Funnily enough if I run the model with fewer X variables the model works, but not always and it seems to depend on which combination of variables I include. On these different occasions I either get the same error message (as above) or I get a new message, (eg. "Error in eigen(val) : infinite or missing values in 'x'" or Error in gls(freq_urban_trans ~ freq_surround_trans + fnest + fhabitat + : <br /> false convergence (8)). Additionally, if I set the starting lambda value to 0 the model runs, but produces a negative estimate of lambda. <br /><br />I have spent some time trying to resolve the issue via searching help lists, but have not been able to resolve the issue. I was wondering if you have any suggestions for why the more complex model will not run, but a simpler model will. <br /><br />Finally, my reasons for using this approach over pgls in caper, is that this approach allows me to summarise the data using the anova command and specify the use of Type III (marginal) sum of squares. This is an important issue for me as my categorical variables have > 2 unordered levels and thus using the summary command does not provide information on the overall effect of the variable. <br /><br />Any suggestions you have for resolving these issues would be greatly appreciated. <br /><br />Many thanks in advance,<br />melissahAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-25802924237142190022014-03-24T19:23:06.505-04:002014-03-24T19:23:06.505-04:00Dear Liam,
Im writing you because id like to know...Dear Liam,<br /><br />Im writing you because id like to know more exactly what its meant when you wrote: <br /><br />In GLS..."we have down-weighted each observation for Y (and corresponding row of X) depending on the correlation of its residual error with the other observations in our set."<br /><br />So far, I think this consists in comparing the residuals of the correlation obtained between two variables with the residuals of the correlation obtained between the same variables simulated along the tree like they followed a brownian motion. If this is right, I could not see how the similarity of the obtained residuals with the expected residuals actually leads to a "downweight" of each observation. Is there any place where these calculations can be followed in R?<br /><br />Im sorry I could no grasp that from your paper your 2010 paper "phylogenetic signal and linear regressions on species data." Despite it is probably actually there.<br /><br />Many thanks in advance<br />AgusAgus Camachohttps://www.blogger.com/profile/07087422729244554168noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-65407221482667257912014-01-10T07:30:50.404-05:002014-01-10T07:30:50.404-05:00Dear Liam,
Is there a way to weigh pgls {caper} m...Dear Liam,<br /><br />Is there a way to weigh pgls {caper} models by samle size?<br /><br />Thanks,<br />JasmineAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-68475871531880381712013-12-10T17:46:00.081-05:002013-12-10T17:46:00.081-05:00This comment has been removed by the author.Jackie Brownhttps://www.blogger.com/profile/08252507999345117879noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-31840839895120451792013-12-10T17:44:17.110-05:002013-12-10T17:44:17.110-05:00This comment has been removed by the author.Jackie Brownhttps://www.blogger.com/profile/08252507999345117879noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-42764541208390802342013-03-15T20:52:09.050-04:002013-03-15T20:52:09.050-04:00Hi Dan.
I would actually recommend you just use g...Hi Dan.<br /><br />I would actually recommend you just use gls in the nlme package.<br /><br />This would look something like the following (for data vectors x & y, and phylogeny, tree):<br /><br />fit<-gls(y~x,data=data.frame(x,y),correlation= corPagel(1,tree),method="ML")<br />anova(fit)<br />resid<-residuals(fit)<br /><br />This should give the same fit, likelihood, and residuals as phyl.resid, and you can also get a P-value for the model using anova.<br /><br />If your tree is not ultrametric there is an extra step:<br /><br />vf<-diag(vcv(tree))<br />fit<-gls(y~x,data=data.frame(x,y),correlation=corPagel(1,tree),method="ML",weights=varFixed(~vf))<br />anova(fit)<br />resid<-residuals(fit)<br /><br />Good luck. Liam<br />Liam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-29613822678152843942013-03-14T14:25:56.633-04:002013-03-14T14:25:56.633-04:00Hi Liam,
I want to get an overall p-value for PGL...Hi Liam,<br /><br />I want to get an overall p-value for PGLS regression with coestimation of lambda. It's clear how to do this with anova() and nlme's gls(), i.e. test against a X ~ 1 null model.<br /><br />However, if I wanted to use phyl.resid() how would I do that? I don't have a large tree, but I do have thousands of regressions to run.<br /><br />Thanks!<br />Dan Fulop.Daniel Fulophttps://www.blogger.com/profile/09024283953150186890noreply@blogger.com