楼主: 诸葛山下
3351 4

[实际应用] 关于R中的rep()函数的运用效率问题 [推广有奖]

  • 5关注
  • 2粉丝

博士生

66%

还不是VIP/贵宾

-

威望
0
论坛币
1605 个
通用积分
3.0757
学术水平
16 点
热心指数
24 点
信用等级
7 点
经验
10655 点
帖子
268
精华
0
在线时间
187 小时
注册时间
2013-3-10
最后登录
2018-12-22

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
在R中输入数据时,当数据有规律的呈现为重复数字时,用rep()函数会很方便,但是实际中重复数字的呈现可能并不明显,这时还有必要用rep()函数吗?大家都是什么情况下用这个函数的。请大家积极参与讨论!
二维码

扫码加我 拉你入群

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

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

关键词:参与讨论 积极参与 重复数 积极参与

沙发
wolfsword 发表于 2014-9-6 00:01:11 |只看作者 |坛友微信交流群
When you meet categorical variables then you will need this function. Specifically, in the experimental study the independent variables are often the categorical variables. At that time you need to impose the categorical variables in regression analysis.

使用道具

藤椅
诸葛山下 发表于 2014-9-6 14:33:47 |只看作者 |坛友微信交流群
wolfsword 发表于 2014-9-6 00:01
When you meet categorical variables then you will need this function. Specifically, in the experimen ...
Can you give me an example? Thank you !

使用道具

板凳
wolfsword 发表于 2014-9-6 14:43:19 |只看作者 |坛友微信交流群
诸葛山下 发表于 2014-9-6 14:33
Can you give me an example? Thank you !
OK. For example, the dependent variable is the rate of cure. Now we have 2 groups. One group feeds Placebo and the other feeds a new medicine. What we want to check is whether the new medicine can improve the rate of cure. Now the independent variable is the dummy. When you input the data in the R, you can use rep() to create the dummy. Furthermore, if you have 3 groups then you have to create 2 variables.

使用道具

报纸
诸葛山下 发表于 2014-9-6 15:49:59 |只看作者 |坛友微信交流群
wolfsword 发表于 2014-9-6 14:43
OK. For example, the dependent variable is the rate of cure. Now we have 2 groups. One group feeds ...
I have got it,thank you!

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

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

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