楼主: Trevor
2473 2

[讨论]Perform regression recursively [推广有奖]

  • 1关注
  • 4粉丝

已卖:1100份资源

副教授

26%

还不是VIP/贵宾

-

TA的文库  其他...

Probability NewOccidental

RapidMiner NewOccidental

Machine Learning

威望
1
论坛币
3509 个
通用积分
0.7297
学术水平
25 点
热心指数
17 点
信用等级
24 点
经验
5225 点
帖子
412
精华
2
在线时间
176 小时
注册时间
2005-5-4
最后登录
2024-4-7

楼主
Trevor 发表于 2005-9-19 07:15:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

I have a dataset that has three variables, say y, x and group. I need to do regression of y on x within each group, and output the predicted along with variables y, x, groups into one dataset. If there are only two groups, I can do it like:

proc reg data=a; where group=1; Model y= x; OUTPUT out=c1 P=PRED ; run; quit;

proc reg data=a; where group=2; Model y= x; OUTPUT out=c2 P=PRED ; run; quit; data combine; set c1 c2; run; But in fact I have 200 groups, I am asking if there is an easy & smart way to do that?

Thanks

Dale

二维码

扫码加我 拉你入群

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

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

关键词:recursively regression regressio Recursive regress 讨论 regression Perform recursively

沙发
Trevor 发表于 2005-9-19 07:16:00

PROC REG ....; BY GROUP; RUN;

WenSui Liu (http://statcompute.blogspot.com) Senior Decision Support Analyst Cincinnati Children Hospital Medical Center

藤椅
Trevor 发表于 2005-9-19 07:20:00

The easy AND smart way to do this is by using the BY-processing features of SAS. I'm putting a PROC SORT in here, in case the data are not sorted on GROUP first. BY-processing needs that. proc sort data=a;

by group;

run;

proc reg data=a; by group; model y= x; output out=c2 P=PRED ; Now you have the regressions done separately, by group. BUT you don't have any regression diagnostics or anything, and you have 200 (or so) regressions to grapple with. Are you sure that you are ending up with a good solution from a statistical point of view? Are you sure that your results are meaningful, if you have no checks for outliers or leverage points or non-linearity? Are you sure that your output will be helpful, when 200 separate tests, all at alpha=0.05, would have about 10 apparently significant results just by chance even if the null hypotheses were true? How will you separate out the specious significant value from the real ones? I think you have a host of potential statistical problems awaiting you. You may want to write back to SAS-L and explain more fully what you are trying to achieve in the big picture here. HTH, David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330

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

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