0

I have a dataset of book sales by rank and the color of the cover. I would like to find a relationship between the rank of the book and the color of the cover.

I'd like to know how to do this analysis in R.

This is how the dataset looks like:

Book MainColor SecondaryColor Ranking
Book 1 White Black 1
Book 2 White Black 2
Book 3 Yellow Red 3
Book 4 Yellow Black 4
Book 5 Pink White 5
Book ... ... ... ...

I'm new to stackexchange and statistics.

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467

1 Answers1

0

If you hve had only one color variable, you could use the rank-basded alternative to one-way anova, which is the Kruskal-Wallis test, see for instance Kruskal-Wallis test data considerations.

But you have two color variables, so the situation is analogous to two-way anova. I would try user Frank Harrell's answer at Is there an equivalent to Kruskal Wallis one-way test for a two-way model?. For an example (with R code) see Which model should I use to fit my data ? ordinal and non-ordinal, not normal and not homoscedastic

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
  • I've searched about the Proportional Odds model, and it seems it is used when you have 2 ordinal variables, which is not the case here. I have one ordinal variable (Book Rank) and one nominal variable (Color) which does not have an order. I've seem this in [this book](https://peopleanalytics-regression-book.org/ord-reg.html) in 7.1.2 – Lucas Tejedor Feb 07 '22 at 18:35
  • NO, proportional odds assume an ordinal response, which you have (ranks). Then you have two factor variables (MainColor, SecondaryColor) which you use as predictors. I have added to the answer. – kjetil b halvorsen Feb 08 '22 at 16:14