请教各位大神,下面是我写的用蒙特卡洛模拟进行一阶单整的虚假回归的程序,可是会出现“rxy commond not found”,请问这是怎么回事???
-----------------------------------------------------------------------------------------
capture program drop I1相关系数
program define I1相关系数,rclass
version 14.1
drop _all
set obs 100
generate u=rnormal()
generate v=rnormal()
generate x=0
generate y=0
generate t=_n
tsset t
forvalues i(2/100){
quietly repalce x=x[`i'-1]+u if t==`i'
}
forvalues j(2/100){
quietly replace y=y[`j'-1]+v if t==`j'
}
corr x y
return scalar rxy=r(rho)
end
simulate xbar=r(rxy), reps(1000):rxy
hist xbar