楼主: 诸葛山下
3690 4

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

  • 5关注
  • 2粉丝

已卖:34份资源

博士生

66%

还不是VIP/贵宾

-

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

楼主
诸葛山下 发表于 2014-9-5 17:36:50 |AI写论文

+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
拉您进交流群
GMT+8, 2026-1-27 17:49