相关性分析怎么判断,怎么看相关性分析结果

首页 > 教育 > 作者:YD1662024-05-08 20:35:44

首先绘制散点图,横轴是克拉数,纵轴是价格(正相关)

qplot(carat,price,data=dat)

相关性分析怎么判断,怎么看相关性分析结果(5)

绘制散点图,对x,y 值取log,可以看出钻石的克拉数和价格是呈现正相关的。

qplot(log(carat),log(price),data=dat)

相关性分析怎么判断,怎么看相关性分析结果(6)

颜色、大小、性状和其他属性的设置

qplot(carat,price,data=dat,colour=color)

相关性分析怎么判断,怎么看相关性分析结果(7)

# 后期应用ggplot() 函数后,可以更加自由的绘制各种组合图形

qplot(carat,price,data=dat,geom=c("point","smooth"))# 添加了一条拟合曲线

相关性分析怎么判断,怎么看相关性分析结果(8)

上一页123下一页

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.