由买买提看人间百态

topics

全部话题 - 话题: forvalues
(共0页)
f***5
发帖数: 1569
1
来自主题: Economics版 - stata问题求助,有包子奖励!
If it is regression:
reg y x1 z
outreg2 using 1.xls, replace keep (x1 z)
reg y x2
outreg2 using 1.xls, keep (x2 z)
If it is others, I have a code like this, but not sure whether it can help u
. U need to use something like APPEND I guess. eg 1 and eg 2is not related
(1) forvalues i=1(1)16 {
use f_oos, clear
forvalues j=1(1)10{
rename f`i'_yr`j' year`j'
}
keep year1 year2 year3 year4 year5 year6 year7 year8 year9 year10
save f`i'_oos,replace
}
(2)
forvalues i=2(1)16 {
append using rs`... 阅读全帖
l***n
发帖数: 812
2
stata has loop function
you can loop by values/function/variables......you name it.
for your purpose:
forvalues i=1(1)500 {
bs "interest rate" "r(sd)",rep(1000)
}
you can check forvalues/foreach function in Stata's manual.
f*****c
发帖数: 3257
3
来自主题: Programming版 - 包子求助matlab编程问题

大湿,问个问题:
我在stata可以如下操作
forvalue i=1/38{
generate bithc`i'="bithch`i'"
}
请问在matlab的话,该怎么写呢
(共0页)