楼主: 快乐女神
1727 6

[Splus与R初级班] 求助R做project时遇到的问题 [推广有奖]

  • 0关注
  • 0粉丝

VIP

高中生

85%

还不是VIP/贵宾

-

威望
0
论坛币
174 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
453 点
帖子
16
精华
0
在线时间
42 小时
注册时间
2009-2-1
最后登录
2017-5-1

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
老师,您好!
我在用R做project时遇到几个问题,请帮忙解决一下!
1.  一个数据集中有20个变量,对其中四个变量进行分析(chol, copper, trig and platelet)。What transformations could you use to make
these more bell-shaped(更偏向于正态分布)? 附件中有数据。
2. 填充缺失值。原来用的都是均值或中位数填缺,但是这里用到了另外一种方法:  We will investigate missing values through a practice called “missing in the
margins”. Replace the missings with a value that is outside the range of the variable, but close enough so that when plotted, it will not look too far off (e.g. the variable log(chol) falls roughly between 4.7 and 7.5 - so you can replace the missings with a value of 3)。This plot will have a lot of overplotting in the missings.  Now jitter the missing values for each of the four variables  by adding noise to them  (in R: you can use the jitter() function, or add random normal noise using rnorm()).   Make sure the variance that you add keeps the missings separate from the rest of the data.  See plot below for an example of how this might look.
有些费解,不知道如何用R去实现。

麻烦老师抽时间尽快帮我解答一下,谢谢咯 !
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Project ect Variables transform formation 数据

附件: 你需要登录才可以下载或查看附件。没有帐号?我要注册
沙发
ruiqwy 发表于 2009-9-25 13:04:45 |只看作者 |坛友微信交流群
您好!
(1)你可以使用对数变换试试!
(2)缺失值的处理确实是个麻烦问题,在某个范围内给个值,然后再加上个随机数,比如正态的。
R is the second language for me!Using R is standing on the shoulders of giants!   Let\'s use R together!

使用道具

藤椅
快乐女神 发表于 2009-9-26 13:21:14 |只看作者 |坛友微信交流群
谢谢您的回复!
能不能把第二条说的更详细一些? 加上一个正态的随机数的作用是什么呢?
如何用R来实现?
谢谢老师!

使用道具

板凳
ruiqwy 发表于 2009-9-26 13:44:48 |只看作者 |坛友微信交流群
加上正态的随机数目的是让数据具有一定的随机性,否则那些数据都是一样的
生成正态随机数命令是 rnorm()
R is the second language for me!Using R is standing on the shoulders of giants!   Let\'s use R together!

使用道具

报纸
快乐女神 发表于 2009-9-27 09:19:18 |只看作者 |坛友微信交流群
数据集中有缺失值,用EDA作图时提示错误 说 变量只能是数值型,列变量里面除了数值型就是缺失值,难道是有缺失值的情况下不能作图? R不能自动把缺失值跳过吗? 这样的话在不填充缺失值的情况下,怎样把缺失值删除呢? 这里面的缺失值不是很重要,我想直接删除掉。

使用道具

地板
快乐女神 发表于 2009-9-27 10:15:43 |只看作者 |坛友微信交流群
我用过exclude~ 但是这个好像是针对缺失值是NA的变量。 我的excel表格中缺失值是用一个点来表示的,所以用了这些删除缺失值的函数都删除不了~ 麻烦老师帮我解决一下,谢谢!

使用道具

7
ruiqwy 发表于 2009-9-27 11:03:47 |只看作者 |坛友微信交流群
na.exclude(数据),可以把含有缺失值的行删去
R is the second language for me!Using R is standing on the shoulders of giants!   Let\'s use R together!

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-1 09:38