楼主: 虞子期
3609 17

[问答] 二分类logistic回归分析 [推广有奖]

11
jingju11 发表于 2013-9-26 20:07:31
right.

12
xingping 发表于 2013-9-26 22:57:20
[color=Green][b]不吃“窝边草”和“回头草”的兔子[/b][/color]

13
xingping 发表于 2013-9-26 23:03:09
Exact method is a good strategy when the data set is small and the model is not very large. Below is a sample code in SAS.
proc logistic data = t2 descending;
  model y = x1 x2;
  exact x1 / estimate=both;
run;
[color=Green][b]不吃“窝边草”和“回头草”的兔子[/b][/color]

14
xingping 发表于 2013-9-26 23:03:53
第二种方法
Firth logistic regression is another good strategy. It uses a penalized likelihood estimation method. Firth bias-correction is considered as an ideal solution to separation issue for logistic regression. For more information on logistic regression using Firth bias-correction,  we refer our readers to the article by Georg Heinze and Michael Schemper.
proc logistic data = t2 descending;
  model y = x1 x2 /firth;
run;
[color=Green][b]不吃“窝边草”和“回头草”的兔子[/b][/color]

15
xingping 发表于 2013-9-26 23:04:53
第三种方法
Bayesian method can be used when we have some additional information on the parameter estimates of the predictor va.
ods graphics on;
data myprior;
  input _type_ $ Intercept x1 x2;
  datalines;
  Var 1 100 100
  Mean 0 1 2
  ;
run;
proc genmod descending data=t2;
  model y =  x1 x2 /dist=binomial link=logit;
  bayes seed=34367 plots=all nbi=2000 nmc=10000
  coeffprior=normal(input=myprior);
  ods output PosteriorSample=Post;
run;
ods graphics off;
[color=Green][b]不吃“窝边草”和“回头草”的兔子[/b][/color]

16
xingping 发表于 2013-9-26 23:05:55
这些方法LZ都去试下,然后贴出结果,我们也看看有什么不同。产生的原因上面几楼已经说清楚了。
[color=Green][b]不吃“窝边草”和“回头草”的兔子[/b][/color]

17
虞子期 发表于 2013-10-10 14:46:53
非常感谢“ xingping” 的回答,在第三种方法中
data myprior;
  input _type_ $ Intercept x1 x2;
  datalines;
  Var 1 100 100
  Mean 0 1 2
  ;
run;这个数据集怎么制定呢?我的数据集有28个变量?如果我用默认的coeffprior选项,貌似可以建模。

18
xingping 发表于 2013-10-10 16:42:11
虞子期 发表于 2013-10-10 14:46
非常感谢“ xingping” 的回答,在第三种方法中
data myprior;
  input _type_ $ Intercept x1 x2;
这些方法我不是很熟,你研究多了应该比我熟。从SAS的编程上看,可能是这样:
data myprior;
  input _type_ $ Intercept x1-x28;
  datalines;
  Var 1 ……
  Mean 0 ……
  ;
……
model y=x1-x28/……


不知道对不对。。。。。你试试
[color=Green][b]不吃“窝边草”和“回头草”的兔子[/b][/color]

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-1 02:21