R语言实战应用精讲50篇(七)-因子
生活随笔
收集整理的這篇文章主要介紹了
R语言实战应用精讲50篇(七)-因子
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
關于Excel數據指標分析,已經上傳到個人資源,以下是鏈接,需要的小伙伴可自取。
Excel數據分析工具庫(t檢驗、Z檢驗、方差分析、回歸、協方差、相關系數、雙樣本方差分析)
https://download.csdn.net/download/wenyusuran/16344167
變量可以簡單地分為連續變量和分類變量(類別變量),分類變量又可以分為名義變量(包括二分類變量和無序多分類變量)和等級變量(有序多分類變量)。分類變量在R中稱為因子。因子在R中很重要,可以影響到數據的分析方式。
函數factor()可以將向量編碼成因子,對分類變量的每一個水平(原始值)賦值為一個整數,并以整數向量的形式儲存起來。
factor {base}: The function factor is used to encode a vector as a factor (the terms "category" and "enumerated type" are also used for factors). If argument ordered is TRUE, the factor levels are assumed to be ordered. For compatibility with S there is also a function ordered.is.factor, is.ordered, as.factor and as.ordered are the membership and coercion functions for these classes.fa總結
以上是生活随笔為你收集整理的R语言实战应用精讲50篇(七)-因子的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 终于不用手撸了,解放你的双手,教你用数学
- 下一篇: R语言实战应用精讲50篇(八)-随机区组