Convert Factor to Dummy Indicator Variables for Every Level in R (Example) | model.matrix Function

preview_player
Показать описание
R code of this video:

x2 = 1,
x3 = 2)

Рекомендации по теме
Комментарии
Автор

Excellent video Joachim!
I like the fact that there is a great variety of topics among your videos, and that each topic is explained well!!

agsoutas
Автор

Thanks for making this video. As I m just new to R, I was confused when we transverse the data as it changes into matrix table. Now I got the answer to it. I would advise please don't be in hurry to sum up.

kishenjit
Автор

How would you make two factor variables into dummies? Would you need two lines of model matrix, or is there a one liner for this?

danielboesing
Автор

Thank you very much, Joachim. However, what I have studied is that we always create dummy variables equal to n - 1, where n is the number of categories. Can you show us the code on how to do that, please? Thanks! :)

eramitvajpeyee
Автор

How do I choose a different base category ?

christianrender