corrplot画图

##(六)描述统计(画图)
library("corrplot")
library("dplyr")
##(1)画图:混合方法之上三角为圆形,下三角为数字
coroutput <-cor(newdata[,c("a15","a285","gender","age","hunyin","lnincome_fam","edu","a35","v458","a36")])
coroutput

colnames(coroutput)<-c("自评健康","互联网","性别","年龄","婚姻","收入","教育","社会评价","社会信任","幸福感")
rownames(coroutput)<-c("自评健康","互联网","性别","年龄","婚姻","收入","教育","社会评价","社会信任","幸福感")

corrplot(coroutput,order = "AOE",type="upper",tl.pos = "d") 
corrplot(coroutput,add=TRUE, type="lower", method="number",order="AOE",diag=FALSE,tl.pos="n", cl.pos="n") 

##(2)画图:上三角为圆形  #tl.pos = "lt",变量名称在左边中间或者不显示。
corrplot(coroutput,method="color",  
         type="upper", order="original", 
         addCoef.col = "black",tl.col = "black",tl.srt=45,diag=FALSE,) 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值