全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2720 0
2015-02-03
我要对上市公司的2005-2014年的季度数据进行一个面板回归:
proc tscsreg data=dbteqr2;
id stkcd ym;
model dlr = ltrshr lpb lroa inA inB inC inD inE inF inG inH inI inJ inK inL inM inN inO inQ inR inS/fixtwo;/*inA-inS是虚拟变量*/
run;
出错:
ERROR: There is only one cross section or time series observation. Computations will be terminated.
在论坛里查了一下资料,说是非平衡面板问题。于是对于原数据集dbteqr作如下处理,消除了只含一个观测值的数据:
/*将那些只有1个观测值的删掉*/
data dbteqr2;
set dbteqr;
if last.stkcd and first.stkcd then delete;
run;
再对dbteqr2做proc tscsreg,仍然报这个错误:ERROR: There is only one cross section or time series observation. Computations will be terminated.
求大神指点!数据中无缺失值,已经全部剔除。原代码如下:
data dbteqr;
set dbteqr;
ym=year(enddt)*10+qtr(enddt);
if lroa^=. & lpb^=. & dlr^=0;
run;
proc sort data=dbteqr;
by stkcd ym;
run;
/*将那些只有1个观测值的删掉*/
data dbteqr2;
set dbteqr;
if last.stkcd and first.stkcd then delete;
run;
proc sort data=dbteqr2;
by stkcd ym;
run;
proc tscsreg data=dbteqr2;
id stkcd ym;
model dlr = ltrshr lpb lroa inA inB inC inD inE inF inG inH inI inJ inK inL inM inN inO inQ inR inS/fixtwo;
run;
求大神指点!!我币不多,全上了!求指教
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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