# BradleyTerry2 TODO

* change grouped_rankings to group_rankings (verb) - deprecate grouped_rankings.
* bud in development PlackettLuce, see beans_3_season.R (pltree)
 - this actually seems related to bug in devel version of BradleyTerry2!!

* predict.BTm with type = "ability" should follow general rules for random effects
 - for fixed effect model level = 0; for mixed effect model level = 1
 - for mixed effect when product does not have fitted random effect, predict 
 should be NA
 
* use newdata[["player1"]] vs newdata$player1 otherwise get warning if newdata is a tibble and the variable is not present
 
* make sure default response works correctly, e.g.
library(BradleyTerry2)
library(dplyr)
library(forcats)
library(ggplot2)
library(qvcalc)
library(readr)
perfume <- read_csv("https://assets.datacamp.com/production/repositories/4100/datasets/08d7c52f12c117418f6e9cfedb529357beba05ea/perfume.csv")
mod <- BTm(1, Winner, Loser, data = perfume)
quasi_variance <- qvcalc(BTabilities(mod))
mod <- BTm(1, Winner, Loser, data = perfume)
quasi_variance <- qvcalc(BTabilities(mod))
perfume_names <- c("Amor Amor", "Angel", "Chanel N°5",
                   "Coco Mademoiselle", "Flower",
                   "Hypnotic Poison", "J'adore",
                   "La Petite Robe Noire",
                   "Lolita Lempicka", "Miss Dior",
                   "Shalimar", "Trésor")
                   
* related to above?: mod3 <- BTm(rep(1, 6), p1, p2, data = BT_data) doesn't work in PlackettLuce
test-log-likelihood                   
 
* add check that if ID factor in with covariates, levels of ID are in order of 
ID variable.
- if player1 /player2 aren't factors, could give factors these levels

* broom to be released as 0.7.0 now accepts matrix response for binomial and 
matrix as reponse - keep using vector response and columns of matrix for 
backward compatibility. Also accepts matrix response for predictions, so perhaps 
this is better way to return "ability"? Would mean dependent on broom > 0.7.0