-3

工作 0:失业者/非技术人员 - 非居民 1:非技术人员 - 居民 2:技术人员/官员 3:管理人员/个体经营者/高素质员工/官员 历史 0:没有学分
1:该银行的所有学分都已按时偿还2: 现有的信用到现在还清 3: 过去延迟还清
4: 关键账户

4

1 回答 1

0

首先:RStudio 是一个 IDE(集成开发环境)。您可能想使用 R(RStudio 使用的语言/统计程序,但也可以独立使用)。

您的问题非常不清楚,但如果(我不确定)您正在寻找一种在回归模型中使用虚拟变量的方法,您可能会考虑使用因子变量:

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
)

威奇会给你:

 [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

和历史类似。

于 2015-03-12T18:59:02.173 回答