JOB
0 : unemployed/ unskilled - non-resident
1 : unskilled - resident
2 : skilled employee / official
3 : management/ self-employed/highly qualified employee/ officer
HISTORY
0: no credits taken
1: all credits at this bank paid back duly
2: existing credits paid back duly till now
3: delay in paying off in the past
4: critical account
Asked
Active
Viewed 2,221 times
-3

doris
- 1
- 3
-
1Please clarify your question. What problem are you trying to solve? How can R help you do that? – Tim Biegeleisen Mar 10 '15 at 02:11
-
how do I create Dummy Variables in RStudio? with numeric data? To transfer JOB into JOB1, JOB2, JOB3 three dummy binary variables. – doris Mar 10 '15 at 02:23
1 Answers
0
First: RStudio is an IDE (Integrated Development Environment). You probably want to use R (the language/stat program that RStudio uses, but that can also be used independently).
Your question is very unclear but if (which I'm not sure of) you're looking for a way to use dummy variables in for example a regression model, you might instead consider a factor variable:
JOB <- factor(sample(1:3, 10, replace = TRUE),
levels= 0:3,
labels = c("unemployed/ unskilled - non-resident",
"unskilled - resident",
"skilled employee / official",
"management/ self-employed/highly qualified employee/ officer"),
ordered = TRUE
)
Wich will give you:
[1] unskilled - resident
[2] unskilled - resident
[3] skilled employee / official
[4] skilled employee / official
[5] skilled employee / official
[6] unskilled - resident
[7] management/ self-employed/highly qualified employee/ officer
[8] unskilled - resident
[9] skilled employee / official
[10] management/ self-employed/highly qualified employee/ officer
4 Levels: unemployed/ unskilled - non-resident < unskilled - resident < ... < management/ self-employed/highly qualified employee/ officer
and similar for HISTORY.

Erik Bülow
- 53
- 4