全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
3605 4
2014-09-05
在R中输入数据时,当数据有规律的呈现为重复数字时,用rep()函数会很方便,但是实际中重复数字的呈现可能并不明显,这时还有必要用rep()函数吗?大家都是什么情况下用这个函数的。请大家积极参与讨论!
二维码

扫码加我 拉你入群

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

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

全部回复
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 !
二维码

扫码加我 拉你入群

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

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

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!
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群