楼主: ReneeBK
2193 1

[疑难杂症]Why SAS Ridge Regression Output is Different from SPSS's? [推广有奖]

  • 1关注
  • 62粉丝

VIP

已卖:4897份资源

学术权威

14%

还不是VIP/贵宾

-

TA的文库  其他...

R资源总汇

Panel Data Analysis

Experimental Design

威望
1
论坛币
49635 个
通用积分
55.6937
学术水平
370 点
热心指数
273 点
信用等级
335 点
经验
57805 点
帖子
4005
精华
21
在线时间
582 小时
注册时间
2005-5-8
最后登录
2023-11-26

楼主
ReneeBK 发表于 2014-5-24 04:55:51 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
I have been reading Applied Linear Statistical Models 5th Edition. The ridge regression is done on a data set available at body fat data. The textbook matches the output in SAS, where the back transformed coefficients are given in the fitted model as Y=-7.3978+0.5553*X1+0.3681*X2-0.1917*X3.

This is shown from SAS as:

proc reg data = ch7tab1a outest = temp outstb noprint;
  model y = x1-x3 / ridge = 0.02;
run;
quit;
proc print data = temp;
  where _ridge_ = 0.02 and y = -1;
  var y intercept x1 x2 x3;
run;
Obs     Y    Intercept       X1         X2         X3

2     -1     -7.40343    0.55535    0.36814    -0.19163
3     -1      0.00000    0.54633    0.37740    -0.13687
But R gives very different coefficients:
data<-read.table("http://www.cst.cmich.edu/users/lee1c/spss/V16_materials/DataSets_v16/BodyFat-TxtFormat.txt",sep=" ",header=FALSE)
data<-data[,c(1,3,5,7)]
colnames(data)<-c("x1","x2","x3","y")
ridge<-lm.ridge(y ~ ., data, lambda=0.02)   
ridge$coef
coef(ridge)

>   ridge$coef
       x1        x2        x3
10.126984 -4.682273 -3.527010
>   coef(ridge)
                   x1         x2         x3
42.2181995  2.0683914 -0.9177207 -0.9921824
>

二维码

扫码加我 拉你入群

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

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

关键词:regression Different regressio regress DIFFER available reading where

本帖被以下文库推荐

沙发
tmdxyz 发表于 2014-5-24 05:23:58
标记一下。准备学习。

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-26 09:36