楼主: fcy23
2960 0

how to specify reference for class statement in glimmix procedure [推广有奖]

  • 0关注
  • 0粉丝

初中生

9%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
59 点
帖子
9
精华
0
在线时间
8 小时
注册时间
2010-10-25
最后登录
2015-2-13

楼主
fcy23 发表于 2011-3-22 04:06:21 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
我是一个新手,有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程序运行有错?希望有高人赶快帮助我呀!
二维码

扫码加我 拉你入群

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

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

关键词:Reference statement Procedure Statemen specify Reference statement glimmix Procedure specify

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-20 05:51