全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1064 0
2015-04-21
相关疾病:



用nlximed运行多水平零膨胀负二项模型,用多水平logistic、多水平负二项做logit和负二项部分初始值,得出结果好多的".",日志有错误报告:WARNING: The final Hessian matrix is not positive definite, and therefore the estimated covariance matrix is not full rank and may be unreliable. The variance of some parameter estimates
is zero or some parameters are linearly related to other parameters. 该怎么修改程序?是哪里出的问题?初始值设定多水平的有没有问题?


程序:proc nlmixed data=sasuser.c7;/*多水平零膨胀负二项(logistic yn)*/

parms A0=-0.2285 Asex=-0.5112 Aage=-0.00767 Aedu=0.07857 Aq32=0.2301 Avolun1=-0.2291
Adrink=-0.4512 Ac10new=0.2190 Ac11new=-0.2265 Apress=-0.1642

B0=-0.09054 bsex=-0.4259 bage=-0.00888 bvolun1=-0.2152 bc10new=0.1656 bc11new=-0.2021
v_u1=1,cov_u12=1,v_u2=1 k=1.85;
s1=A0+Asex*sex+Aage*age+Aedu*edu+Aq32*q32+Avolun1*volun1+
Adrink*drink+Ac10new*c10new+Ac11new*c11new+Apress*press+u1;
p=1/(1+exp(-s1));
s2=B0+Bsex*sex+Bage*age+Bvolun1*volun1+Bc10new*c10new+Bc11new*c11new+u2;
lambda=exp(s2);
pdf=gamma(n+1/k)/(gamma(n+1)*(gamma(1/k)))*(((k*lambda)**n)/(1+k*lambda)**(n+1/k));
if n=0 then pdf=p+(1-p)*pdf;
else pdf=(1-p)*pdf;

if pdf>1e-8 then ll=log(pdf);
else ll=-1e20;

model n~general(ll);
random u1 u2~normal([0,0],[v_u1,cov_u12,v_u2]) subject=site;
run;

程序结果(部分截图):




二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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