Set up

For this lecture we need to packages following packages. We load the packages with library().

library("PlackettLuce")
library("qvcalc")
library("gosset")
library("patchwork")
library("ggparty")
library("climatrends")
library("nasapower")
library("ClimMobTools")

Example 1: Sweetpotato data

We first read the .csv file with the function read.csv()

dt <- read.csv("data/sweet_potato.csv")
str(dt)
## 'data.frame':    1433 obs. of  20 variables:
##  $ id            : int  6 18 24 25 27 56 62 63 73 74 ...
##  $ country       : chr  "Uganda" "Uganda" "Uganda" "Uganda" ...
##  $ district      : chr  "Gulu" "Gulu" "Gulu" "Gulu" ...
##  $ gender        : chr  "Woman" "Woman" "Man" "Man" ...
##  $ trial         : chr  "community" "community" "community" "community" ...
##  $ item_A        : chr  "NASPOT 10 (Kabode)" "Kakamega" "NASPOT 13" "NASPOT 12" ...
##  $ item_B        : chr  "NASPOT 12" "NASPOT 8" "NASPOT 10 (Kabode)" "NASPOT 10 (Kabode)" ...
##  $ item_C        : chr  "NASPOT 13" "NASPOT 13" "Kakamega" "NASPOT 13" ...
##  $ best_overall  : chr  "B" "B" "A" "A" ...
##  $ worst_overall : chr  "A" "A" "C" "B" ...
##  $ best_taste    : chr  "C" "B" "A" "A" ...
##  $ worst_taste   : chr  "B" "C" "C" "B" ...
##  $ best_color    : chr  "B" "C" "B" "C" ...
##  $ worst_color   : chr  "C" "B" "A" "A" ...
##  $ best_describe : chr  "It has high dry matter content" "nice, sweet" "sweet" "very sweet and nice" ...
##  $ worst_describe: chr  "not too sweet" "sweet" "wet" "it is wet and not sweet" ...
##  $ community     : chr  NA NA NA NA ...
##  $ age           : chr  NA NA NA NA ...
##  $ geno_test     : chr  NA NA NA NA ...
##  $ region        : chr  NA NA NA NA ...

For this analysis we keep only the Ghana data

dt <- dt[dt$country == "Ghana", ]

And then we transform the tricot rankings into a PlackettLuce rankings. We use the overall preference on the genotypes

R <- rank_tricot(data = dt,
                 items = c("item_A","item_B","item_C"),
                 input = c("best_overall","worst_overall"))


head(R)
##                                        419 
## "SARI-Nan > SARI-Diedi (Tu-Purple) >  ..." 
##                                        420 
## "PG17305-N1 > SARI-Diedi (Tu-Purple)  ..." 
##                                        421 
## "SARI-Diedi (Tu-Purple) > PG17305-N1  ..." 
##                                        422 
## "SARI-Nyumingre (Obare) > PG17305-N1  ..." 
##                                        423 
## "SARI-Nyumingre (Obare) > PG17265-N1  ..." 
##                                        424 
## "SARI-Nyumingre (Obare) > PG17140-N2  ..."

Fit a PlackettLuce model

To fit a PlackettLuce model we use the function PlackettLuce(). To know more about the model read the paper by Turner et al (2020).

mod <- PlackettLuce(R)

summary(mod)
## Call: PlackettLuce(rankings = R)
## 
## Coefficients:
##                        Estimate Std. Error z value Pr(>|z|)    
## CIP442162               0.00000         NA      NA       NA    
## CRI-Apomuden           -0.50383    0.18382  -2.741 0.006128 ** 
## CRI-Ligri              -0.29860    0.18349  -1.627 0.103664    
## PG17136-N1              0.60760    0.20933   2.903 0.003700 ** 
## PG17140-N2             -0.97825    0.21498  -4.550 5.35e-06 ***
## PG17206-N5             -0.42867    0.20743  -2.067 0.038774 *  
## PG17265-N1             -0.30215    0.20639  -1.464 0.143194    
## PG17305-N1             -0.03831    0.20502  -0.187 0.851767    
## PG17362-N1             -0.19461    0.20701  -0.940 0.347154    
## PG17412-N2             -0.64490    0.20807  -3.099 0.001939 ** 
## PGN14011-24            -0.46418    0.22658  -2.049 0.040494 *  
## PGN16021-39            -0.38181    0.22402  -1.704 0.088322 .  
## PGN16024-27            -0.53794    0.22304  -2.412 0.015870 *  
## PGN16024-28            -0.39930    0.22308  -1.790 0.073469 .  
## PGN16030-30            -0.88195    0.23026  -3.830 0.000128 ***
## PGN16092-6             -0.43790    0.22537  -1.943 0.052011 .  
## PGN16130-4             -0.45238    0.22236  -2.034 0.041904 *  
## PGN16203-18            -0.52260    0.22491  -2.324 0.020149 *  
## SARI-Diedi (Tu-Purple) -0.53984    0.18336  -2.944 0.003239 ** 
## SARI-Nan                0.14675    0.18539   0.792 0.428611    
## SARI-Nyumingre (Obare)  0.16792    0.18411   0.912 0.361734    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual deviance:  3501.8 on 3025 degrees of freedom
## AIC:  3541.8 
## Number of iterations: 16

We define a reference item (variety). This helps us in identifying whether a widely used variety is better of worse than the new genotypes.

ref = "SARI-Nyumingre (Obare)"

summary(mod, ref = ref)
## Call: PlackettLuce(rankings = R)
## 
## Coefficients:
##                        Estimate Std. Error z value Pr(>|z|)    
## CIP442162              -0.16792    0.18411  -0.912 0.361734    
## CRI-Apomuden           -0.67175    0.14676  -4.577 4.71e-06 ***
## CRI-Ligri              -0.46652    0.14647  -3.185 0.001447 ** 
## PG17136-N1              0.43968    0.18730   2.347 0.018905 *  
## PG17140-N2             -1.14617    0.19745  -5.805 6.44e-09 ***
## PG17206-N5             -0.59659    0.18389  -3.244 0.001178 ** 
## PG17265-N1             -0.47007    0.18375  -2.558 0.010521 *  
## PG17305-N1             -0.20623    0.18108  -1.139 0.254754    
## PG17362-N1             -0.36253    0.18769  -1.932 0.053420 .  
## PG17412-N2             -0.81282    0.18591  -4.372 1.23e-05 ***
## PGN14011-24            -0.63210    0.18666  -3.386 0.000708 ***
## PGN16021-39            -0.54973    0.18557  -2.962 0.003054 ** 
## PGN16024-27            -0.70586    0.18201  -3.878 0.000105 ***
## PGN16024-28            -0.56722    0.18167  -3.122 0.001794 ** 
## PGN16030-30            -1.04987    0.19282  -5.445 5.19e-08 ***
## PGN16092-6             -0.60582    0.18555  -3.265 0.001094 ** 
## PGN16130-4             -0.62030    0.18331  -3.384 0.000715 ***
## PGN16203-18            -0.69052    0.18389  -3.755 0.000173 ***
## SARI-Diedi (Tu-Purple) -0.70776    0.14694  -4.817 1.46e-06 ***
## SARI-Nan               -0.02117    0.14910  -0.142 0.887103    
## SARI-Nyumingre (Obare)  0.00000         NA      NA       NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual deviance:  3501.8 on 3025 degrees of freedom
## AIC:  3541.8 
## Number of iterations: 16

The model coefficients can be obtained using the function coef(). The first example take the coefficients in the log format, the log-worth. If we apply the argument log = FALSE this returns the probability of winning (worth). The sum of these probabilities should always be 1.

coef(mod, ref = ref)
##              CIP442162           CRI-Apomuden              CRI-Ligri 
##            -0.16791946            -0.67174879            -0.46652334 
##             PG17136-N1             PG17140-N2             PG17206-N5 
##             0.43967813            -1.14617258            -0.59659002 
##             PG17265-N1             PG17305-N1             PG17362-N1 
##            -0.47007388            -0.20623080            -0.36253350 
##             PG17412-N2            PGN14011-24            PGN16021-39 
##            -0.81282308            -0.63209741            -0.54972776 
##            PGN16024-27            PGN16024-28            PGN16030-30 
##            -0.70586233            -0.56721708            -1.04987293 
##             PGN16092-6             PGN16130-4            PGN16203-18 
##            -0.60581769            -0.62029882            -0.69052107 
## SARI-Diedi (Tu-Purple)               SARI-Nan SARI-Nyumingre (Obare) 
##            -0.70775981            -0.02116773             0.00000000
coef(mod, log = FALSE)
##              CIP442162           CRI-Apomuden              CRI-Ligri 
##             0.06235524             0.03767581             0.04625843 
##             PG17136-N1             PG17140-N2             PG17206-N5 
##             0.11448517             0.02344353             0.04061661 
##             PG17265-N1             PG17305-N1             PG17362-N1 
##             0.04609448             0.06001151             0.05132786 
##             PG17412-N2            PGN14011-24            PGN16021-39 
##             0.03271861             0.03919973             0.04256530 
##            PGN16024-27            PGN16024-28            PGN16030-30 
##             0.03641223             0.04182734             0.02581341 
##             PGN16092-6             PGN16130-4            PGN16203-18 
##             0.04024354             0.03966497             0.03697515 
## SARI-Diedi (Tu-Purple)               SARI-Nan SARI-Nyumingre (Obare) 
##             0.03634321             0.07221151             0.07375635
sum(coef(mod, log = FALSE))
## [1] 1

We can plot these coefficients with the error bars using the function qvcalc()

plot(qvcalc(mod, ref = ref))

PlackettLuce with covariates

With the function pltree() we can fit a PlackettLuce model recursively to find instabilities in the rankings that are represented by a set of covariates. The rankings are recursively split into two groups according to their value on covariates whose values vary between rankings, and a PlackettLuce model is fitted to each subgroup formed. The method proceeds as follows:

  1. Fit a Plackett–Luce model to the full data.

  2. Assess the stability of the worth parameters with respect to each covariate. That is, test for a structural change in the ranking-level contributions to the first derivatives of the log-likelihood, when these contributions are ordered by covariate values.

  3. If there is significant instability, split the full data by the covariate with the strongest instability, using the cut-point that gives the highest improvement in model fit.

  4. Repeat steps 1-3 for each subgroup until there are no more significant instabilities, or a split produces a subgroup below a given size threshold.

We select the covariates age and gender. We coerce age into integer and gender into factor.

sel <- c("age", "gender")

covar <- dt[sel]

covar$age <- as.integer(covar$age)
## Warning: NAs introduced by coercion
covar$gender <- as.factor(covar$gender)

Let’s check for NA’s in these variables. We use the function apply() to run over the rows of covar an look for the sum of NAs in each row. A value of 0 means no NA, which is what we are looking for.

sum(is.na(covar))
## [1] 8
keep <- apply(covar, 1, function(x){
  sum(is.na(x))
})

keep <- keep == 0

Apply the filter in the dt and covar data frames

covar <- covar[keep, ]
dt <- dt[keep, ]

We then use the function rank_tricot() to create the grouped_rankings. This allows the rankings to be linked to the covariates and fit the model using pltree(). The rankings are combined with the covariates using the function cbind().

G <- rank_tricot(data = dt,
                 items = c("item_A","item_B","item_C"),
                 input = c("best_overall","worst_overall"),
                 group = TRUE)

pldt <- cbind(G, covar)

head(pldt)
##                        G age gender
## 419 SARI-Nan > SARI- ...  26    Man
## 420 PG17305-N1 > SAR ...  37    Man
## 421 SARI-Diedi (Tu-P ...  35    Man
## 422 SARI-Nyumingre ( ...  25    Man
## 423 SARI-Nyumingre ( ...  36    Man
## 424 SARI-Nyumingre ( ...  42    Man

Now we can fit the tree. The first argument is the formula with response variable being the first followed by the covariates indicated with a ~ sign.

pl <- pltree(G ~ age + gender, data = pldt, alpha = 0.1)

summary(pl)
## $`2`
## Call: PlackettLuce(rankings = y, weights = weights, na.action = NULL, 
##     start = start)
## 
## Coefficients:
##                         Estimate Std. Error z value Pr(>|z|)    
## CIP442162               0.000000         NA      NA       NA    
## CRI-Apomuden           -0.561385   0.205699  -2.729 0.006350 ** 
## CRI-Ligri              -0.272198   0.205269  -1.326 0.184821    
## PG17136-N1              0.439174   0.232960   1.885 0.059404 .  
## PG17140-N2             -1.139375   0.245704  -4.637 3.53e-06 ***
## PG17206-N5             -0.653822   0.238588  -2.740 0.006137 ** 
## PG17265-N1             -0.386940   0.234359  -1.651 0.098727 .  
## PG17305-N1             -0.003812   0.232765  -0.016 0.986935    
## PG17362-N1             -0.378680   0.235082  -1.611 0.107214    
## PG17412-N2             -0.657257   0.237991  -2.762 0.005750 ** 
## PGN14011-24            -0.403071   0.253849  -1.588 0.112323    
## PGN16021-39            -0.369354   0.254594  -1.451 0.146847    
## PGN16024-27            -0.600758   0.255263  -2.353 0.018598 *  
## PGN16024-28            -0.425007   0.260435  -1.632 0.102698    
## PGN16030-30            -0.897314   0.268615  -3.341 0.000836 ***
## PGN16092-6             -0.436958   0.256094  -1.706 0.087963 .  
## PGN16130-4             -0.442447   0.247762  -1.786 0.074136 .  
## PGN16203-18            -0.691483   0.255624  -2.705 0.006829 ** 
## SARI-Diedi (Tu-Purple) -0.541247   0.205436  -2.635 0.008423 ** 
## SARI-Nan                0.069627   0.208161   0.334 0.738013    
## SARI-Nyumingre (Obare)  0.397274   0.208438   1.906 0.056656 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual deviance:  2659.5 on 2311 degrees of freedom
## AIC:  2699.5 
## Number of iterations: 13
## 
## $`3`
## Call: PlackettLuce(rankings = y, weights = weights, na.action = NULL, 
##     start = start)
## 
## Coefficients:
##                        Estimate Std. Error z value Pr(>|z|)   
## CIP442162               0.00000         NA      NA       NA   
## CRI-Apomuden           -0.29731    0.43768  -0.679  0.49695   
## CRI-Ligri              -0.34969    0.43812  -0.798  0.42477   
## PG17136-N1              1.53343    0.51871   2.956  0.00311 **
## PG17140-N2             -0.59500    0.49121  -1.211  0.22578   
## PG17206-N5              0.32490    0.45826   0.709  0.47834   
## PG17265-N1             -0.02583    0.46488  -0.056  0.95569   
## PG17305-N1              0.04864    0.46698   0.104  0.91705   
## PG17362-N1              0.67153    0.48942   1.372  0.17003   
## PG17412-N2             -0.48299    0.46158  -1.046  0.29538   
## PGN14011-24            -0.57525    0.52658  -1.092  0.27465   
## PGN16021-39            -0.35483    0.49943  -0.710  0.47741   
## PGN16024-27            -0.35840    0.49139  -0.729  0.46577   
## PGN16024-28            -0.23410    0.47581  -0.492  0.62272   
## PGN16030-30            -0.81432    0.48687  -1.673  0.09441 . 
## PGN16092-6             -0.45015    0.50449  -0.892  0.37224   
## PGN16130-4             -0.33332    0.53055  -0.628  0.52984   
## PGN16203-18             0.09125    0.50900   0.179  0.85772   
## SARI-Diedi (Tu-Purple) -0.42444    0.43658  -0.972  0.33095   
## SARI-Nan                0.60874    0.43369   1.404  0.16043   
## SARI-Nyumingre (Obare) -0.47264    0.43136  -1.096  0.27321   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual deviance:  770.24 on 670 degrees of freedom
## AIC:  810.24 
## Number of iterations: 16

The rankings split with the covariate age. We can use the function plot() to see the tree.

plot(pl)

The function plot_tree() is still under development in the package gosset. With this function we can see the tree with the points and error bar.

gosset:::plot_tree(pl)

We can also extract the coefficients from each node like before.

coef(pl)
##   CIP442162 CRI-Apomuden  CRI-Ligri PG17136-N1 PG17140-N2 PG17206-N5
## 2         0   -0.5613845 -0.2721977  0.4391743 -1.1393753 -0.6538218
## 3         0   -0.2973133 -0.3496924  1.5334272 -0.5949976  0.3248989
##    PG17265-N1   PG17305-N1 PG17362-N1 PG17412-N2 PGN14011-24 PGN16021-39
## 2 -0.38694033 -0.003811507 -0.3786803 -0.6572568  -0.4030712  -0.3693541
## 3 -0.02583033  0.048636011  0.6715318 -0.4829928  -0.5752502  -0.3548321
##   PGN16024-27 PGN16024-28 PGN16030-30 PGN16092-6 PGN16130-4 PGN16203-18
## 2  -0.6007577  -0.4250075  -0.8973138 -0.4369585 -0.4424469 -0.69148324
## 3  -0.3584040  -0.2340996  -0.8143235 -0.4501455 -0.3333179  0.09125216
##   SARI-Diedi (Tu-Purple)   SARI-Nan SARI-Nyumingre (Obare)
## 2             -0.5412468 0.06962682              0.3972741
## 3             -0.4244423 0.60873996             -0.4726361

The model can also be used for predictions with the function predict()

head(predict(pl))
##      CIP442162 CRI-Apomuden  CRI-Ligri PG17136-N1 PG17140-N2 PG17206-N5
## 419 0.06450597   0.03679542 0.04913443  0.1000762 0.02064313 0.03354662
## 420 0.06450597   0.03679542 0.04913443  0.1000762 0.02064313 0.03354662
## 421 0.06450597   0.03679542 0.04913443  0.1000762 0.02064313 0.03354662
## 422 0.06450597   0.03679542 0.04913443  0.1000762 0.02064313 0.03354662
## 423 0.06450597   0.03679542 0.04913443  0.1000762 0.02064313 0.03354662
## 424 0.06450597   0.03679542 0.04913443  0.1000762 0.02064313 0.03354662
##     PG17265-N1 PG17305-N1 PG17362-N1 PG17412-N2 PGN14011-24 PGN16021-39
## 419 0.04380804 0.06426057  0.0441714 0.03343158  0.04310705  0.04458528
## 420 0.04380804 0.06426057  0.0441714 0.03343158  0.04310705  0.04458528
## 421 0.04380804 0.06426057  0.0441714 0.03343158  0.04310705  0.04458528
## 422 0.04380804 0.06426057  0.0441714 0.03343158  0.04310705  0.04458528
## 423 0.04380804 0.06426057  0.0441714 0.03343158  0.04310705  0.04458528
## 424 0.04380804 0.06426057  0.0441714 0.03343158  0.04310705  0.04458528
##     PGN16024-27 PGN16024-28 PGN16030-30 PGN16092-6 PGN16130-4 PGN16203-18
## 419  0.03537481  0.04217174  0.02629671 0.04167075 0.04144266   0.0323067
## 420  0.03537481  0.04217174  0.02629671 0.04167075 0.04144266   0.0323067
## 421  0.03537481  0.04217174  0.02629671 0.04167075 0.04144266   0.0323067
## 422  0.03537481  0.04217174  0.02629671 0.04167075 0.04144266   0.0323067
## 423  0.03537481  0.04217174  0.02629671 0.04167075 0.04144266   0.0323067
## 424  0.03537481  0.04217174  0.02629671 0.04167075 0.04144266   0.0323067
##     SARI-Diedi (Tu-Purple)   SARI-Nan SARI-Nyumingre (Obare)
## 419              0.0375439 0.06915737             0.09596964
## 420              0.0375439 0.06915737             0.09596964
## 421              0.0375439 0.06915737             0.09596964
## 422              0.0375439 0.06915737             0.09596964
## 423              0.0375439 0.06915737             0.09596964
## 424              0.0375439 0.06915737             0.09596964

Example 2: Breadwheat data

The breadwheat is a dataframe from tricot trials of bread wheat (Triticum aestivum L.) varieties in India. This is a sample data available at ClimMob that can be fetched using the function getDataCM() from ClimMobTools.

key <- "d39a3c66-5822-4930-a9d4-50e7da041e77"

dt <- getDataCM(key = key,
                project = "breadwheat",
                pivot.wider = TRUE)


names(dt)
##  [1] "id"                                 "package_participant_name"          
##  [3] "package_item_A"                     "package_item_B"                    
##  [5] "package_item_C"                     "package_project_name"              
##  [7] "registration_surveyid"              "registration_survey_deviceimei"    
##  [9] "registration_survey_start"          "registration_survey_end"           
## [11] "registration_participant_name"      "registration_district"             
## [13] "registration_village"               "registration_familiyofthefarmer"   
## [15] "registration_age"                   "registration_gender"               
## [17] "registration_telephone"             "registration_farm_geo_longitude"   
## [19] "registration_farm_geo_latitude"     "lastassessment_surveyid"           
## [21] "lastassessment_survey_deviceimei"   "lastassessment_survey_start"       
## [23] "lastassessment_survey_end"          "lastassessment_grainquality_pos"   
## [25] "lastassessment_grainquality_neg"    "lastassessment_yield_pos"          
## [27] "lastassessment_yield_neg"           "lastassessment_overallperf_pos"    
## [29] "lastassessment_overallperf_neg"     "firstassessment_surveyid"          
## [31] "firstassessment_survey_deviceimei"  "firstassessment_survey_start"      
## [33] "firstassessment_survey_end"         "firstassessment_earlygrowth_pos"   
## [35] "firstassessment_earlygrowth_neg"    "firstassessment_plantingdate"      
## [37] "firstassessment_farm_geo_longitude" "firstassessment_farm_geo_latitude"

We remove some strings in the colunm names

names(dt) <- gsub("firstassessment_|package_|lastassessment_|registration_", 
                  "",
                  names(dt))

Tricot data with environmental covariates

We can add environmental covariates from package climatrends. Here we use the function temperature() to compute the temperature indices for the first 80 days after planting. We first convert the planting dates into an object of class Date, and the longitude and latitude into numeric.

dt$plantingdate <- as.Date(dt$plantingdate, format = "%Y-%m-%d")
dt$lon <- as.numeric(dt$farm_geo_longitude)
dt$lat <- as.numeric(dt$farm_geo_latitude)

temp <- temperature(dt[, c("lon","lat")], 
                    day.one = dt[, "plantingdate"],
                    span = 80)
## Getting climate data from NASA POWER
temp
##      maxDT minDT maxNT minNT   DTR    SU    TR   CFD  WSDI  CSDI  T10p  T90p
##      <dbl> <dbl> <dbl> <dbl> <int> <int> <int> <int> <int> <int> <dbl> <dbl>
## 1:   30.75 20.65 17.67  4.63    15     2     0     0     3     2  5.50 27.73
## 2:   29.16 20.65 16.52  4.63    15     0     0     0     4     2  5.50 27.45
## 3:   32.77 20.65 18.49  4.63    15     7     0     0     8     2  5.50 29.17
## 4:   29.16 20.65 16.52  4.63    15     0     0     0     3     2  5.50 27.25
## 5:   29.16 20.65 16.52  4.63    15     0     0     0     4     2  5.50 26.22
## ---                                                                         
## 489: 29.16 20.65 16.52  4.63    15     0     0     0     3     2  5.50 27.25
## 490: 29.16 20.65 16.52  4.63    15     0     0     0     3     2  5.50 27.25
## 491: 32.77 20.65 17.67  4.63    15     5     0     0     6     2  5.50 28.41
## 492: 29.16 20.65 16.52  4.63    15     0     0     0     3     2  5.50 27.25
## 493: 29.16 20.65 16.52  4.63    15     0     0     0     3     2  5.50 27.25

We build the farmers’ rankings as an object of class ‘grouped_rankings’.

G <- rank_tricot(dt, 
                 items = c("item_A","item_B","item_C"), 
                 input = c("overallperf_pos","overallperf_neg"),
                 group = TRUE)

dat <- cbind(G, temp)

We fit the model using the function pltree()

pl <- pltree(G ~ maxNT + maxDT, 
             data = dat)

summary(pl)
## $`2`
## Call: PlackettLuce(rankings = y, weights = weights, na.action = NULL, 
##     start = start)
## 
## Coefficients:
##           Estimate Std. Error z value Pr(>|z|)    
## CSW18       0.0000         NA      NA       NA    
## DBW17      -1.4614     0.4132  -3.537 0.000405 ***
## DPW621-50  -2.0924     0.4376  -4.782 1.74e-06 ***
## HD2824     -3.1032     0.4347  -7.138 9.46e-13 ***
## HD2932     -2.7048     0.4320  -6.261 3.83e-10 ***
## HD2985     -2.0511     0.4413  -4.648 3.35e-06 ***
## HI1563     -3.4131     0.4425  -7.713 1.23e-14 ***
## HP1633     -3.4306     0.4323  -7.936 2.09e-15 ***
## HW2045     -3.5339     0.4396  -8.039 9.03e-16 ***
## K0307      -3.4931     0.4458  -7.835 4.67e-15 ***
## K9107       0.2791     0.4794   0.582 0.560486    
## PBW343     -0.6595     0.4512  -1.462 0.143852    
## PBW502     -3.1382     0.4539  -6.914 4.71e-12 ***
## PBW550     -3.2180     0.4269  -7.537 4.79e-14 ***
## RAJ4120    -3.0018     0.4331  -6.932 4.16e-12 ***
## WR544      -3.3246     0.4380  -7.590 3.20e-14 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual deviance:  766.05 on 855 degrees of freedom
## AIC:  796.05 
## Number of iterations: 25
## 
## $`3`
## Call: PlackettLuce(rankings = y, weights = weights, na.action = NULL, 
##     start = start)
## 
## Coefficients:
##           Estimate Std. Error z value Pr(>|z|)    
## CSW18       0.0000         NA      NA       NA    
## DBW17      -0.7026     0.4481  -1.568 0.116904    
## DPW621-50  -1.5821     0.4475  -3.535 0.000408 ***
## HD2824     -2.5380     0.4852  -5.231 1.69e-07 ***
## HD2932     -1.5077     0.4469  -3.374 0.000741 ***
## HD2985     -1.1698     0.4286  -2.729 0.006343 ** 
## HI1563     -2.3205     0.4502  -5.154 2.54e-07 ***
## HP1633     -2.1386     0.4676  -4.574 4.79e-06 ***
## HW2045     -1.9125     0.4482  -4.267 1.98e-05 ***
## K0307      -2.3455     0.4467  -5.251 1.51e-07 ***
## K9107       1.1110     0.5217   2.129 0.033215 *  
## PBW343      0.2557     0.4366   0.586 0.558045    
## PBW502     -1.9471     0.4245  -4.586 4.51e-06 ***
## PBW550     -2.1052     0.4693  -4.486 7.26e-06 ***
## RAJ4120    -2.5301     0.4974  -5.087 3.64e-07 ***
## WR544      -2.1327     0.4498  -4.741 2.13e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual deviance:  559.08 on 594 degrees of freedom
## AIC:  589.08 
## Number of iterations: 16
gosset:::plot_tree(pl)



desousakaue k.desousa@cgiar.org