全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
2474 1
2007-12-24
    各位大侠,小妹刚刚接触R的,别人给了我一个函数,可是不知道怎么用。可否烦请大家指点一下。先谢谢了哦 :-P推荐一下R的入门教材也可以。

它说按下面的方法使,可是我完全 不懂。5555555555555555
To illustrate and check the above code,the following command may be executed at the R prompt:
      pars = get.vaTer(.802,.112,.723)
Typing“pars”at the R prompt will then display the following:
函数为:
get.vaTer = function(Pc,VRT,MRT,s=0.1)
{
s2=s^2
#The default value for the scaling parameter s equals 0.1
if(Pc == 0)
cat(“Oops,Pc == 0!\n”)
if(Pc == 0.5)
cat(“Oops,Pc ==.5!\n”)
if(Pc == 1)
cat(“Oops,Pc == 1!\n”)
#If Pc equals 0,.5,or 1,the method will not work,and
#an edge correction is required.
L = qlogis(Pc)
#The function“qlogis”calculates the logit.
x = L*(L*Pc^2-L*Pc + Pc-.5)/VRT
v = sign(Pc-.5)*s*x^(1/4)
#This gives drift rate.
a = s2*qlogis(Pc)/v
#This gives boundary separation.
y =-v*a/s2
MDT =(a/(2*v))*(1-exp(y))/(1+exp(y))
Ter = MRT-MDT
#This gives nondecision time.
return(list(v,a,Ter))
}




二维码

扫码加我 拉你入群

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

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

全部回复
2007-12-27 11:56:00
1、source函数
2、粘贴复制

而后,敲入必要的函数名称和参数。
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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