Skip to main content
3 of 4
edited tags
ttnphns
  • 58.8k
  • 53
  • 287
  • 512

How does coding matter for categories?

So say the predictor variable is coded 1,2,3,4 for 4 different cities. Is this bad? I've heard that it only makes sense for things that have a natural ordering. Like number of stars for a movie or something. But in R, if you do factor(city), it basically splits it up into 3 different dummy variables. So why does the distinction matter then?