Changelog
Source:NEWS.md
phylopath 1.4.0
This release is mainly aimed at avoiding a common confusion about phylopath output, that was long-standing and avoidable. When models would use both continuous and binary variables, the coefficients would be very confusing to interpret, since they mix scales and are not consistently standardized. The package now tries to be much more vocal about what path coefficients actually mean and warn the user about mixing coefficients with different types.
Note that this concerns the coefficients only, comparison of the causal models is not an issue.
New features in this release:
Models that contain both binary and continuous variables now warn, once per session, that their coefficients cannot be compared with one another. Every plot and printout of such a model repeats this more briefly, and
coef_plot()refuses to sort the paths by"strength", since that ordering would be partly an artefact of the scales.plot()on a fitted model no longer labels its colour legend “standardized path coefficient” regardless of what the coefficients are, but names the scale that is actually shown.fitted_DAGobjects gain abinaryelement, recording which variables were modelled as binary. Objects made by earlier versions do not have it, and are reported without a scale rather than being assumed to be standardized.New
as.data.frame()method for fitted models, returning the estimated paths as adata.framewith one row per path. This function supports aorder_byargument just likecoef_plot()to order the paths.New
coef()andconfint()methods for fitted DAGs, returning the path coefficients as a named vector and the bounds of their bootstrapped confidence intervals.phylo_pathnow supports more than 26 models.
There are also a lot of bug fixes and minor improvements in reporting. It is unlikely any of these have affected real analyses, as they deal with either imprecise reporting or very unlikely edge cases:
plot.phylopath_summarynow has a help page.Bug fix:
coef_plot(order_by = "causal")derived the causal ordering from the positive coefficients only, so the ordering was incorrect in the presence of negative paths.Bug fix:
CICccould not be calculated when the number of parameters was exactly one less than the number of species, but silently returnedInfinstead ofNA. Affected models now returnNA.Bug fix: the
phylo_parcolumn now correctly reports the alpha parameter in the case of GLMs.Bug fix: model sets in which only some of the models were named kept empty names for the others, which made those models impossible to select with
best()andchoice(). Unnamed models in a partially named set are now labelled in the same way as those in a fully unnamed set.Bug fix: the notice pointing to
show_warnings()was only shown when more than one model produced a warning, so a single warning went unmentioned.Bug fix:
show_warnings()and the error for variables with more than two levels appendedFALSEto their messages.best()andaverage()now return an informative error whenCICccould not be calculated for one or more of the models, rather than failing with an uninformative error.Informative errors are now returned when a variable is used in the causal models but is not a column of
data, when theorderargument does not contain exactly the variables used in the models, and when two causal models are given the same name.All errors, warning and messages have been reviewed for clarity, and many now have more consistent language, more information, and give tips on how to resolve the issue. They also use
rlangnow, for nicer formatting.est_DAG()now defaults tomodel = "lambda"andmethod = "logistic_MPLE", matchingphylo_path(). Previously these arguments had no defaults, so callingest_DAG()without them failed.Bug fix: implemented more consistent handling of very small p-values and avoidance of numerical underflow.
Updated
ggplot2code to remove deprecated functionality.Fixed several inaccuracies in the vignettes, including a reference to a function that does not exist, and restored two
coef_plot()examples in the introduction.Fitted models now report clearly what their coefficients are. Paths into a binary variable are log odds ratios, while paths into a continuous variable are standardized regression coefficients, and previously both were presented as though they were the same quantity.
New
print()method for fitted models, which lists the estimated paths with their coefficients and intervals, and states which variables are continuous and which are binary, rather than printing the underlying matrices.coef_plot()now names the scale of the coefficients on its axis, instead of always describing them as standardized.Bug fix:
est_DAG()did not recognize binary variables supplied as character vectors, although those are documented as acceptable, andphylo_path()accepts them. Such a variable failed with an error fromphylolmwhen it was the outcome of a path, and was silently treated as continuous when it was the predictor. Character variables are now converted to factors, as they already were inphylo_path().Bug fix:
plot_model_set()located the edges of a causal model incorrectly when a model was not topologically sorted, which could silently draw edges that were not in the model and omit ones that were.Bug fix: passing an argument that neither
phylolm()norphyloglm()accepts produced one warning per fitted regression, and did not say which argument was at fault. Such arguments are now reported once per call, by name.The vignettes now have descriptive titles in the vignette index, and all figures have alt-text.
Added a unit test suite covering the d-separation basis set, the model comparison statistics, model averaging, and the plotting functions.
phylopath 1.3.1
CRAN release: 2025-09-06
- Maintenance update to confirm to update CRAN documentation guidelines.
phylopath 1.3.0
CRAN release: 2024-06-11
- MuMIn was removed as a dependency, as it was threatened to be removed from CRAN.
phylopath 1.2.1
CRAN release: 2024-03-18
A warning is now generated when a user passes a data column with binary data as a numeric vector.
Informative errors are now returned when the
orderargument does not contain each variable exactly once.Fixed a rare bug in
find_consensus_order, due to a particular edge case of order combinations. In old R versions this would generate a warning about the anifcondition with length > 1, which in newer versions results in an error. (Thanks to Laura Alencar for the report.)
phylopath 1.2.0
CRAN release: 2023-10-09
Replaced parallel processing based on the
parallelpackage andpbapplyto usefutureinstead. Use e.g.future::plan("multisession", workers = n)to enable parallel processing for both model comparison (parallel over dsep statements) and model estimation (when using bootstrapping).Fixed a bug that no longer allowed parallel processing in
phylo_path.Fixed a bug where the range of the width scale for paths in
plot.fitted_DAGwas incorrectly set to themax(weight), instead ofmax(abs(weight)). (Thanks Yu Xu for the report.)Better user messaging and documentation around the use of the
bootparameter.Update of binary vignette to include more info on convergence warnings.
phylopath 1.1.3
CRAN release: 2021-10-04
Fixed a bug that made
phylo_pathfail to pass additional (…) arguments correctly tophylolm.Add informative error when trying to plot a DAG without any paths.
Updated plotting functions to work with new
ggraphreleases.Fixed regression with parallel usage of
phylo_pathdue to an S3 inheritance issue on the cluster (#16, thanks Simon Greenhill for the report).
phylopath 1.1.2
CRAN release: 2019-12-07
Prepare for R v4.0.0.
Bug fix: Very low p-values could cause underflow and result in infinite C statistics. All p-values are now set to be at least the size of the machine accuracy (i.e. 2 * 10^-16).
Warnings are now again correctly reported.
phylopath 1.1.0
CRAN release: 2019-07-12
-
Bug fix: It was possible to get CICc values in the summary output that were not valid. Specifically, to calculate CICc there is a division by
(n - 1 - q), wherenis the number of observations (species) andqthe number of parameters in the causal model. This could lead to infinite CICc whenn == q + 1, or a flipped of CICc whenn < q + 1. This would typically only occur when attempting to fit models with very few species (e.g. < 10).New behavior is to set CICc to
NAwhennis insufficient, and to give a warning. Removed dependencies
dplyrandtidyr, but addedtibble.
phylopath 1.0.1
CRAN release: 2018-07-08
Fixed bug that would return the wrong model in some error messages.
Improved reporting of warnings, and a
show_warnings()function has been added.Citation info now points to the PeerJ paper.
phylopath 1.0.0
CRAN release: 2017-11-03
Citation info now points to the bioRxiv paper.
All modeling functions now completely rely on the
phylolmpackage, and no longer useape. This is a major change, that will possibly change the outcomes of some of your existing analyses (as can happen when chaning the modeling package). There are, however, several good reasons to make this change, which I think make it worth the trouble. Firstly, the package is much faster for large trees, and this effect is compounded inphylopathbecause one may have to fit a few dozen models. Secondly, I think it is important to have confidence intervals around the regression coefficients, and those were not available forape::binaryPGLMM. Thirdly,phylolmmakes it easy to use a larger variety of models of evolution, including two versions of OU and early burst, which can be simply set using themodelparameter. Lastly, thephylolm()andphyloglm()functions give more uniform results, which makes it easier to code for situation where you may use both.phylo_pathand all related methods now deal automatically with both continuous and binary data. All separate binary functions and methods have disappeared as they are no longer needed. Mixing of binary and continious data in the same models is now allowed.The variable order in d-seperation statements now better follows the causal flow of the DAG.
Added
plot()method forphylopath.summaryobjects, that shows the weights and p-values for the different models.coef_plot()gainederror_bar,order_by,fromandtoarguments. The first allows the user to choose between confidence invervals and standard errors, the second to order the paths by several methods, and the last two can be used to select only certain paths.Plotting methods of causal models now support a manual layout.
Plotting of fitted DAG’s now uses edge width instead of color to indicate, the standardized regression coefficient strength, but this can be reverted using the
typeargument.Added a
define_model_set()convenience function for building models, that avoids repeated calls toDAG()and has an argument to supply paths that are shared between all your models. It is not needed to specify isolate variables. Old code usingDAG()continues to work as normal.Added support for additional arguments passed to
glsfromphylo_path. This can be helpful, for example, for setting the fitting method to maximum likelihood (method = "ML").
phylopath 0.3.1
CRAN release: 2017-08-09
####Bugfixes:
The package broke due to an update of
purrr, but has now been fixed (reported by Christoph Liedtke, @hcliedtke).The package depends on a recent version of
nlme, but this wasn’t specified. All package versions of dependencies are now defined (reported by @ManuelaGonzalez).
phylopath 0.3.0
CRAN release: 2017-07-06
Added support for completely binary models, that are fitted with
ape::binaryPGLMM. Usephylo_path_binary()to compare models.average(),best()andchoice()are now S3 generics and will handle both continuous and binary versions. Usage is designed to be as close to the continuous version as possible.est_DAG_binary()powers the binary S3 methods.All plot functions that used
DiagrammeRnow useggraphinstead. This gives much more control over the positioning of the nodes, and allows to plot multiple models at once. Exporting plots also becomes much easier.You can now plot a list of causal models with
plot_model_set(). This creates a faceted plot where all nodes are kept in the same location, which makes it easier to spot how models are different.
phylopath 0.2.3
CRAN release: 2017-03-23
If there are any
NAvalues indatafor the variables inmodels, these rows are now dropped fromdatawith a message. Usena.rm = FALSEto revert to the old behavior.When PGLS models fail, an informative error is now returned to the user.
phylo_path()now checks for row.names that line up with the tree tip labels. If the tree contains surplus species, it gets pruned to size with a message. This includes cases where species are dropped due to missing values.citation()now correctly refers to the methods paper by Von Hardenberg & Gonzalez-Voyer first and the package second.
phylopath 0.2.2
CRAN release: 2017-01-04
Fewer models are now fitted when using
phylo_path(), since any duplicated independence statements are now only fitted once. This leads to a significant reduction in running time in many cases, especially when many models are considered.Implemented support for parallel processing in
phylo_path()using theparallelargument.phylo_path()now shows a progress bar.New function added (
choice()) that is a very simple wrapper aroundest_DAG(). It adds tobest()andaverage()by allowing for choosing any model as the final model, and encourages users to not always pick the lowest CICc model.Prepared plotting functions for new release of
DiagrammeR, v0.9 now required.
phylopath 0.2.1
CRAN release: 2016-11-10
IMPORTANT: Faulty model averaging has been fixed. This was often introduced due to differences in matrix ordering. Averaging results from versions before 0.2.1 should NOT be trusted.
Using
ape::corBrownian()no longer returns an error.Averaging is less likely to fail due to errors in
nlme::intervals().
phylopath 0.2.0
CRAN release: 2016-10-05
phylo_path()has become more streamlined with functionality moved to other functions. Thephylopathobject now contains all necessary models and data,summary()is used to obtain the results table, andbest()andaverage()are used to extract and fit the best or average model. See the vignette for details.Model averaging for arbitrary models is now possible with
average_DAGs().Model averaging now supports both conditional and full model averaging.
Both the old
est_DAG()and the newaverage_DAGs()now return objects of a new classfitted_DAG, that has it’s separateplotmethod. Theplotmethod for objects of classDAGhas been simplified.Model averaging now returns standard errors and confidence intervals based on the
MuMInpackage (issue #1).A new function
plot_coefsfor plotting regression coefficients and their confidence intervals has been added.