tag:blogger.com,1999:blog-8499895524521663926.post6948828231800913643..comments2024-03-27T07:13:39.236-04:00Comments on Phylogenetic Tools for Comparative Biology: New version of pgls.IvesLiam Revellhttp://www.blogger.com/profile/04314686830842384151noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-8499895524521663926.post-24495177931282853302015-08-31T03:29:29.297-04:002015-08-31T03:29:29.297-04:00Hi Liam,
Could you please clarify whether this fu...Hi Liam,<br /><br />Could you please clarify whether this function takes multiple dependent variables?<br /><br />ThanksAnonymoushttps://www.blogger.com/profile/07578348663274168595noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-22173138389022565412015-03-01T19:40:54.490-05:002015-03-01T19:40:54.490-05:00Hi Liam,
What is the best way to evaluate the sign...Hi Liam,<br />What is the best way to evaluate the significance of the regression fit in pgls.Ives? My output looks similar to your example above:<br />> (Kaemp_fit)<br />$beta<br />[1] 963.2129971 0.1879864<br /><br />$sig2x<br />[1] 3560480732<br /><br />$sig2y<br />[1] 426536077<br /><br />$a<br />[1] 2326.028 1400.474<br /><br />$logL<br />[1] -161.5189<br /><br />$convergence<br />[1] 0<br /><br />$message<br />[1] "CONVERGENCE: REL_REDUCTION_OF_F <= FACTR*EPSMCH"<br /><br />But, when I use the summary(Kaemp_fit) command, it doesn't produce anything regarding the fit of the data:<br /> Length Class Mode <br />beta 2 -none- numeric <br />sig2x 1 -none- numeric <br />sig2y 1 -none- numeric <br />a 2 -none- numeric <br />logL 1 -none- numeric <br />convergence 1 -none- numeric <br />message 1 -none- character<br /><br />What would you recommend?<br />Thanks!<br />Andrea<br />aeberardihttps://www.blogger.com/profile/10832324191601977183noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-63181715577791876542014-11-07T16:08:34.224-05:002014-11-07T16:08:34.224-05:00Well, it seems that I've fixed my own mistake....Well, it seems that I've fixed my own mistake. I was using the wrong vectors, working with species means and variances instead of letting each species entry exist individually in the vector. Cheers!aeberardihttps://www.blogger.com/profile/10832324191601977183noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-89860544313980361522014-10-27T18:46:37.471-04:002014-10-27T18:46:37.471-04:00Hi Liam,
I'm having trouble with the pgls.Ives...Hi Liam,<br />I'm having trouble with the pgls.Ives function with my data. I have three samples for 7 species and one sample for 1 species for a total of 8 species. I've calculated the means and variances using aggregate so that I have a separate vector each for means and variances (and each entry is a sample, so there are up to three entries for the same species). The variance for one of the species is NA since there is only one sample.<br /><br />Here is my command:<br />pgls.Ives(MetaboTree, Fl_PC1_bar, Lf_PC1_bar, Fl_PC1_var, Lf_PC1_var)<br />And here is the error:<br />Error in pd.solve(varcov, log.det = TRUE) : NA's in x<br /><br />Any suggestions on where to look? When I remove the var variables and just execute:<br />pgls.Ives(IochromaMetaboTree, Fl_PC1_bar, Lf_PC1_bar)<br />Then it says:<br />Error in sig2x * C + diag(Mx) : non-conformable arrays<br /><br />The length of the tree tips, means, and variances are all 8, and the is.na function doesn't reveal any apparent NAs.<br /><br />Thanks!<br />Andreaaeberardihttps://www.blogger.com/profile/10832324191601977183noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-31835293066445136392013-11-23T22:10:10.540-05:002013-11-23T22:10:10.540-05:00Hi Liam,
This function allows incorporating sampl...Hi Liam,<br /><br />This function allows incorporating sampling error in the estimation of the mean (i.e. standard error of the mean), but is it possible to incorporate the within species sample variance (i.e. the standard deviation)?<br /><br />All the best,<br /><br />JulienAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-25866088999958724152013-04-08T12:25:33.234-04:002013-04-08T12:25:33.234-04:00Hi Laszlo.
Thanks for the suggestion. Maybe I'...Hi Laszlo.<br /><br />Thanks for the suggestion. Maybe I'll add that kind of input flexibility in the future at some point.<br /><br />Here's a handy work-around that makes it very easy to run the function using the data structure you describe.<br /><br />OK, let's say you have a data frame XX containing species names (with repeating species names for multiple samples per species), data vector x, and data vector y. Just run:<br /><br />fit <- pgls.Ives(tree, x=setNames(XX$x,XX$species), y=setNames(XX$y,XX$species))<br /><br />That's it!<br /><br />All the best, LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-78333410852289923342013-04-08T03:27:37.885-04:002013-04-08T03:27:37.885-04:00Hi Liam,
I tried to run the script on real data. U...Hi Liam,<br />I tried to run the script on real data. Usually, comparative data (both species-specific or individual-specific) are sorted in dataframes, in which species names are given in separate columns. With this structure the "aggregate" function does not work, returns with " Error in aggregate.data.frame(as.data.frame(x), ...) : arguments must have same length". Thus I have to calculate species-specific means and variances separately or restructure the data before running pgls.Ives. However, it would be much more convenient for the user, if you could change the command line for aggregate to take the species names from columns such as aggregate(my.data$X, by=list(my.data$species),FUN=mean).<br />Thanks.<br />All the best,<br />Laszlo Garamszegi<br />Anonymousnoreply@blogger.com