This is the first CRAN release since 1.5.1. It includes every change in 1.6.0, which was released on GitHub only, so read both sections when upgrading from CRAN. The major version reflects three things. Several functions return different results after a statistical review, the package drops five dependencies, and tree plots are drawn without ggparty. Function names and arguments are unchanged, and code written for 1.5.1 runs without edits.
kendallW() now uses only the items each participant ranked. Observed
rankings mark unranked items with 0, and earlier versions kept those
zeros as tied ranks against the predicted ranks of all items. With
tricot data, where each participant ranks three of many items, this
distorted W. Expect different values for trees fitted on tricot data.
Rows with fewer than two ranked items are skipped. Results on complete
rankings are unchanged.likelihood_ratio() computes the degrees of freedom as the sum of the
ranks of the group models minus the rank of the global model. Earlier
versions used the difference in residual degrees of freedom.
PlackettLuce counts residual df from the possible selections in each
choice set, which depend on the largest tie order in the data. When
groups differed in tie structure, the residual df were not additive and
the test could get thousands of spurious degrees of freedom and a
p-value near 1. Results are unchanged when all groups share the same
tie structure. Reported by Sergio Castro Pacheco (CIRAD).plot() on a pltree object failed with "mapping must be created by
aes()" under current ggplot2 releases, which caused the CRAN check
errors for 1.5.1. The error came from ggparty, which rebuilds aes()
objects in a way ggplot2 now rejects and which fails its own CRAN
checks for the same reason. The tree branches are now drawn with
ggplot2 and partykit. The internal build_tree_branches() keeps its
signature and still returns a ggplot object, so ClimMob-analysis is
unaffected. Edge and node labels look slightly different.plot() on PlackettLuce and pltree objects no longer gives
ggplot2 deprecation warnings. geom_errorbarh() is replaced by
geom_errorbar(orientation = "y") and size by linewidth for lines.btpermute() failed with "subscript out of bounds" when
n.iterations was smaller than the number of predictors, because the
model formulas were built per iteration instead of per predictor.grid::unit() was used without grid being declared, and is now
ggplot2::unit().kendallW()
computes W in base R, rank_numeric() reshapes data in base R, and the
soft deprecation of rank_numeric() is a base R warning given once per
session.btpermute() asks for
BradleyTerry2 when it is missing. compare() uses ggrepel for the
labels when it is installed and geom_text() otherwise.linewidth.kendallW(), rank_numeric(),
compare() and btpermute(). The suite has 120 tests and runs
without warnings.kendallW() has an example and documents how unranked items are
handled.This release corrects statistical errors found in a review of the package. Some results change. Check the items under CHANGES IN RESULTS before comparing with analyses run on earlier versions.
kendallTau() on matrices tests the average tau with each row
(participant) as an independent ranking, and weights rows by their
number of pairs. Earlier versions pooled all pairs into one ranking of
N_effective items, which understated precision. With 2,000 random
triads the z-values had a standard deviation of about 0.2 instead of 1,
so real associations were often reported as not significant. Expect
larger z-values and smaller p-values in trials with many participants.
Average tau is unchanged for complete triads. N_effective is still
reported, for reference only.
kendallTau() gains alternative = c("two.sided", "greater", "less").
The default is now two-sided. Earlier versions reported a one-sided
p-value for a positive association. The column name Pr(>|z|) is
unchanged. null.rm is now passed from the matrix method to each row.
crossvalidation() reports Kendall's tau for Plackett-Luce trees on the
held-out test set. Earlier versions compared predictions with the
training rankings, an in-sample measure. Values will be lower and
honest.
preference_index() counts each item once per set. Earlier versions
inflated n by the number of other items in each set and gave larger
sets more weight in the averages. Sets with a single ranked item are
skipped. The bottom probability is computed exactly by recursion over
subsets.
regret() assigns each regret to the right item when nodes are not in
sorted order (for example terminal node 10 before node 3). This affected
trees with node ids of 10 or more, including worthSE and regretSE.
regret() weights nodes by their share of observations for pltree
objects, and models by their number of rankings for lists of
PlackettLuce models, so a small node no longer counts as much as a
large one. Worst regret, a worst case, is not weighted. The new
node.weights argument sets weights; equal weights reproduce the
previous results.
anova() for Plackett-Luce models no longer rounds the log-likelihood
difference before computing the statistic, and computes the p-value
with lower.tail = FALSE.
likelihood_ratio() computes the p-value with lower.tail = FALSE.
kendallTau_bootstrap() resamples participants with replacement and
returns the pair-weighted average tau of each resample. Earlier versions
computed tau on only four subsets of the data and bootstrapped those four
values, which gave a poor estimate of the variability of tau. The
function also reset the random number stream; with seed it now leaves
the caller's stream unchanged, and without seed it uses the current
stream. Arguments and output format are unchanged.
crossvalidation() keeps folds aligned with the data when rows are
dropped for missing values, accepts folds given as a list of training
rows, stops with an error when a model or a score cannot be computed
(instead of returning zeros), and no longer changes the caller's random
number stream when seed is given. The package of the model (for
example 'PlackettLuce' or 'gnm') must be attached, and the function
says so when it is not.likelihood_ratio() checks the split vector, accepts grouped rankings
as in its documented example and passes ... to PlackettLuce().rank_tricot2() reads factor ranks by their values and gains
strict = FALSE, an opt-in check for missing, duplicated, tied and
non-consecutive ranks.rank_tricot() warns when the same item appears twice in a row.Corrected typos and unclear wording in the help pages (for example
btpermute() named a non-existent argument n.iteractions, and the
arguments of the default method of kendallW() were described as
pltree objects).
Unit tests in tests/testthat cover these functions and run under
R CMD check, including a simulation of the null distribution of
kendallTau().
Added an R CMD check workflow for Linux, macOS and Windows, and
AGENTS.md, a guide for AI agents working on the package.
Added preference_index() to compute a model-based preference index
from Plackett–Luce worth parameters.
The function reports, for each item:
Added rank_tricot2() — a redesigned ranking parser for tricot data.
The function:
rank_numeric() to interface with rank_tricot2() for improved performance and error handling.plot.pltree()kendallTau_permute() and kendallTau_bootstrap()plot.PlackettLuce()cassava to the datasetscassava consumer testing data and new vignetteworth_map() are extracted using stats::coefficients() instead of psychotools::itempar()resample() to re-sample Plackett-Luce coefficientsregret()pairwise_probs() to compare worth parameters following the Luce's Axiomregret(). Using sum(x^2) instead of sum(x)^2anova() method for PlackettLuce modelslikelihood_ratio()kendallTau() returns Z-value and p-valuesrank_binomial() and rank_paircomp() are renamed as set_binomialfreq() and set_paircomp(), respectivelyvalidate.rankings to rank_tricot() to help in identifying possible issues in input tricot ranking like NA, ties or letters different than A, B or Caverage to kendallTau() to allow returning the kendall correlation for each entry in a matrix and PlackettLuce rankingna.omit to kendallTau() to remove entries with NA= instead of <- to avoid typing stressplot.pltree() when multi-comparison is required but multicompView is not loaded.reliability(), btpermute(), pseudo_rank(), kendallW()plot.pltree() to build branches and panels independentlyFirst version on CRAN
plot_tree()rank_numeric() deals with ids of class charactersref can be used in multicompPL() to select the reference itemplot() method for summarise_agreement() using the argument scales, where scales = 100 is to set the scale from 0-100 and scales = 1 for a scale from 0-1multcompPL()rank_binomial() in assigning the ids when argument disaggregate = TRUEbtpermute(), with the fix n.formula = n.vars + 1forward()btpermute() is added for model selection with BTm()rainfall(), temperature(), ETo() and GDD() migrates to climatrendsrank_numeric() in restricted to floating point numbers. Integer values are ranked as provided by input.rainfall() and temperature() now allows for time series indicesRename functions agreement(), dominance(), favourite(), and victories() with the tag summarise and add it into summarise functions. No warking message provided. New functions are summarise_agreement(), summarise_dominance(), summarise_favourite(), and summarise_victories()
Argument 'index' is removed from rainfall() and temperature(),
all indices are given by default
.get_timeseries() now implements the Euclidean method to search for its nearest neighbour in the nasapower output. This optmises the function and reduce dependenciespseudoR2() as a S3 method for objects of class "glm", "gnm", "bttree" and "pltree"kendallTau() as S3 method for objects of class "numeric", "matrix", "data.frame", "rankings", "grouped_rankings"agreement(), dominance(), favourite() and victories()predict() method for crossvalidation and rank_decimal() deprecatedrank_numeric() and rank_tricot() replaces rank_PL(). NO warning message addedpredict() method for crossvalidation objectspseudoR2() for object of class "pltree" extracts null loglik from PlackettLuceto_rankings() by rank_PL(). Warning message addednum2rank() by rank_decimal(). No warning message addedto_paircomp() by rank_paircomp(). No warning message added