全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1162 7
2015-01-19
data dd;
input f e n d@@;
lgn=log(n);
cards;
1 1 240 216  1  0  100  63  2  1  60  48  2  0  210  84
;
proc genmod data=dd  order=data;
class f;
model d=e f/dist=poisson
link=log   type1 type3;
run;
proc genmod data=dd;
class f;
make 'obstats' out=outdata;
model d=f/dist=poisson link=log offset=lgn
type1 type3  obstats;
run;
proc print data=outdata;
run;
data k; set outdata;
set dd;
rate=exp(xbeta);run;proc print;
run;

二维码

扫码加我 拉你入群

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

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

全部回复
2015-1-19 10:26:17
It is a typical log-linear model fitted in generalized linear regression models in SAS. you are measuring the rate or proportion whe you are using offset variable.
只是你应该注意的是泊松分布是小概率事件。216 out of 240? Unless they are in different units.比如说,240万辆车保险里每月216个重大事故。
jingju
二维码

扫码加我 拉你入群

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

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

2015-1-19 10:29:36
jingju11 发表于 2015-1-19 10:26
It is a typical log-linear model fitted in generalized linear regression models in SAS. you are meas ...
前面那两个1 1 是啥
二维码

扫码加我 拉你入群

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

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

2015-1-19 10:31:40
看不明白你的问题
二维码

扫码加我 拉你入群

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

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

2015-1-19 10:37:02
llkknnllyytt 发表于 2015-1-19 10:29
前面那两个1 1 是啥
f=1, 2; e = 1, 0.
They could be factors that have impact on the counts.
Class f is to take f as a classification variable in the model. Say, f = 1 vs. 2 can be male vs. female, older vs. younger,…
e is treated as continuous in the model;  But for the dummy variable 0/1, they are no difference if you treat it as continuous or discrete.

JingJu
二维码

扫码加我 拉你入群

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

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

2015-1-19 10:47:41
jingju11 发表于 2015-1-19 10:37
f=1, 2; e = 1, 0.
They could be factors that have impact on the counts.
Class f is to take f as  ...
请问可以去掉一个1吗
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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