全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2923 1
2020-04-11
请教各位前辈和大神们,用SAS做固定效应模型,程序如下:
proc panel data=all;
   id  area1_ year;
   class gender_ age_ education_ marriage_ work health_ visit area2  insurance_ family_ old_age_support_ socialfreq_;
   model total_med_cost=gender_ age_ education_ marriage_ work health_ disability chronic_dis visit income area2  
      insurance_ family_ old_age_support_ socialfreq_/fixtwo;
run;

问题1:area1_是”城乡“二分类变量,报错如下:ERROR: Data set WORK._CLSS_ is not sorted in ascending sequence with respect to time series ID.  The current time period  has year=2011 and the previous time period has year=2015 in cross section area1_=2.   对变量重新排序后还是报错,该问题是因为area1_这个变量不唯一吗?应该如何解决这个问题?
问题2:想对一些分类变量哑变量化,并指定对照组,该如何写程序?
二维码

扫码加我 拉你入群

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

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

全部回复
2020-4-21 12:58:03
复制代码
其中,var1 是个体的识别变量,var2 是时间序列变量。

在模型中控制分类变量的话,就是在 class 语句。
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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