全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2925 0
2011-03-22
我是一个新手,有N多编程问题的新手,再此弱问一个关于glimmix的问题,希望有高手指正。据我所知,glimmix procedure 不支持对class做reference, 无法由用户来指定reference for category variable. 所以我采用了proc transreg,希望能解决这一问题。以下是部分相关程序。

Data try2;
Set try;
If hyper_con=1 then output;
Run;

Proc format;
Value sex 1='male'
2='female';
Value region_final
1='northeast'
2='midwest'
3='south'
4='west';
Value povcat
1='high income'
2='mid income'
3='low income'
4='near poor'
5='poor';
Value rthlth_final
1= 'excellent health'
2='very good health'
3='good health'
4='fair health'
5='poor health';
/*newly add*/
value married
0='not married'
1='married'
;
value divorced
0='not divorced' 1='divorced'
;
value black
0='not black' 1='black' ;
value hispanic
0='not hispanic' 1='hispanic' ;
value urban 0='not urban'
1='urban' ;
value conditions
0='no more than one condition'
1='more than one condition'
;




Value yr
1='2003'
2='2004'
3='2005'
4='2006'
5='2007';
Value inss
1='uninsured'
2=' HINDC'
3='HIWDC'
4='HMODC';
Run;
data try3;
set try2;
format
sex sex. Region_final
region_final. Povcat povcat. Rthlth_final
rthlth_final.
married married.
divorced divorced. black black. hispanic hispanic.
urban urban.
conditions conditions.
Yr yr. inss inss.;
run;


proc transreg design data=try3;
model class (sex
region_final povcat rthlth_final married divorced black hispanic urban conditions yr /zero='male' 'northeast' 'high income'
'excellent health'
'not married'
'not divorced'
'not black' 'not hispanic'
'not urban' 'no more than one condition' );
id dupersid age sicpay payvac famszeyr high_school
BA
MA
employed
unemployed
selfemployed
union
limit
coglim
chddx
midx angidx
ohrtdx
strkdx
adrisk adsmok inss;
output out=xmatrix;
run;


ods pdf file="GLIMMIX multilogistic hypertension1.pdf" style=journal;


Proc glimmix data=xmatrix;
Format sex sex.
Region_final
region_final. Povcat povcat. Rthlth_final
rthlth_final.

married married.
divorced divorced. black black. hispanic hispanic.
urban urban.
conditions conditions.
Yr yr. inss inss.;

Model inss (order=formatted) = age
sex
black
Hispanic
povcat
sicpay payvac famszeyr
married
divorced high_school
BA
MA
employed
unemployed
selfemployed
union
region_final
urban

Rthlth_final
limit
coglim
chddx
midx angidx
ohrtdx
strkdx
adrisk adsmok conditions
yr /solution
dist=multinomial
link=glogit;
Weight
weight_yr;
Run;


在最后model statement运行后,log中有错误提示:


ERROR: Invalid or missing data.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE GLIMMIX used (Total process time):

real time
2.06 seconds

cpu time
0.68 seconds




The output results shows:



The GLIMMIX Procedure

Model Information

Data Set
WORK.XMATRIX

Response Variable
inss

Response Distribution
Multinomial (nominal)

Link Function
Generalized Logit

Variance Function
Default

Weight Variable

Estimation Technique
Maximum Likelihood

Degrees of Freedom Method
Residual


Number of Observations Read
25159

Number of Observations Used
0

ERROR: Invalid or missing data.


请问碰到这个问题怎么解决呢?在新生成的xmatrix data中,每个category variable都产生了新的变量和相应数据。比如:我指定northeast为region_finalbaseline, 那么新的数据库将会生成3个新变量,region_final  south, region_final
west and region_final  midwest, 如果该subject的观察值是northeast, 则相对应新变量的数值将为 0 0 0 。 问题在于xmatrix data生成后,为什么glimmix程序运行有错?希望有高人赶快帮助我呀!
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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