楼主: xuezhongcao
10786 9

[问答] 请问logistics回归分析中Cox-Snell R2的计算公式是什么?怎么计算 [推广有奖]

教师

已卖:78份资源

教授

17%

还不是VIP/贵宾

-

威望
0
论坛币
32884 个
通用积分
7.5821
学术水平
13 点
热心指数
26 点
信用等级
15 点
经验
61608 点
帖子
941
精华
0
在线时间
1282 小时
注册时间
2007-9-15
最后登录
2025-10-17

楼主
xuezhongcao 在职认证  发表于 2016-5-17 23:22:20 |AI写论文
5论坛币

本文在计算交叉验证时,需要计算logistics回归的Cox-Snell R2值,但是找不到公式,不知道怎么计算。求助大家,如何用R语言实现,具体的数据可以用下面的链接

http://blog.csdn.net/comaple/article/details/45062489

关键词:LOGISTICS logistic logisti ogistic logist logistics 回归分析
已有 1 人评分论坛币 收起 理由
happy_287422301 + 60 鼓励积极发帖讨论

总评分: 论坛币 + 60   查看全部评分

沙发
happy_287422301 在职认证  发表于 2016-5-17 23:24:15
不太懂,但我可以赞助点论坛币:谁能第一个或者最好滴解决这个问题,我分别赞助200论坛币吧。

藤椅
woodhaven 发表于 2016-5-18 01:54:26
Cox-Snell R2 is the maximum likelihood R2. The formula is in the table at the following website.

http://www.ats.ucla.edu/stat/mult_pkg/faq/general/Psuedo_RSquareds.htm

已有 1 人评分论坛币 收起 理由
happy_287422301 + 40 观点有启发

总评分: 论坛币 + 40   查看全部评分

板凳
woodhaven 发表于 2016-5-18 02:04:40
1-(LM0/LMF)^2/N
LM0 is the log likelihood for the intercept
LMF is the log likelihood for the full model

报纸
xuezhongcao 在职认证  发表于 2016-5-18 08:56:02
请问公式怎么写呢?我想用R程序实现,怎么实现?

地板
xuezhongcao 在职认证  发表于 2016-5-18 08:56:44
happy_287422301 发表于 2016-5-17 23:24
不太懂,但我可以赞助点论坛币:谁能第一个或者最好滴解决这个问题,我分别赞助200论坛币吧。
谢谢!

7
xuezhongcao 在职认证  发表于 2016-5-18 08:57:11
woodhaven 发表于 2016-5-18 01:54
Cox-Snell R2 is the maximum likelihood R2. The formula is in the table at the following website.

...
我也看过这个网页,但是具体的计算,怎么计算?

8
woodhaven 发表于 2016-5-18 10:55:51
xuezhongcao 发表于 2016-5-18 08:57
我也看过这个网页,但是具体的计算,怎么计算?
Here is an example:
# First estimate a model containing the intercept only

fit1 <- glm(Species ~.,family=binomial(link='logit'),data=ir_train)
summary(fit1)

#Next estimate a model containing the predictors, X1 and X2.

fit2 <- glm(Species ~X1 + X2,family=binomial(link='logit'),data=ir_train)
summary(fit2)

#Find LM0 from summary(fit1) and LMF from summary(fit2)
# Use the equation 1-(LM0/LMF)^2/N

9
xuezhongcao 在职认证  发表于 2016-5-20 13:38:27
谢谢,这个程序很清楚。
我是在十折交叉验证时出现的问题。
(1)100个数数据随机分成十份(train(90个数据)和validation(10个数据);
(2)train(90个数据)做回归分析,newlm <- glm(model5,data=train,family=binomial())
(3)用validation(10个数据)做样本,计算估计值,newpred <- predict(newlm,newdata=validation,type ="response")
(4)然后在选择90个数据做回归分析,另外10个数据估计。
(5)重复10次,所有的数据都有预测值了。
(6)计算Cox-Snell R2 (不会计算了)。
代码:
见附件!

10
皖山一流 学生认证  发表于 2016-10-18 21:08:28
这个具体公式怎么算呀?急求呀、、、

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

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