全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
1494 3
2014-03-01
分了好多组做OLS然后取残差,每组的样本容量大小不一,有的可能不能满足自由的的条件,Stata好像又不能自动识别出这种情况依旧进行估计,在做循环时怎样避免这种组别的回归?谢谢!
二维码

扫码加我 拉你入群

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

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

全部回复
2014-3-1 22:37:06
you can just add a conditional statement before running the reg, for example, suppose 100 is the min sample size you want for running the reg

forv I=1/100 {
count if group==`i'
if r(N)>=100 {
reg ..........................
}
}


if you have very small sample size, even if bigger than you DF requirement, does it make sense to run reg?
二维码

扫码加我 拉你入群

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

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

2014-3-2 09:14:59
jjjj6666 发表于 2014-3-1 22:37
you can just add a conditional statement before running the reg, for example, suppose 100 is the min ...
我想要的是,只要满足自由度条件的就回归,不满足的就不进行。
二维码

扫码加我 拉你入群

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

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

2014-3-2 10:44:48
then just change 100 to what ever number you want.
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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