SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 613|回复: 0
打印 上一主题 下一主题

求助实现一下程序,小弟拜谢,很急。

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2009-12-18 23:07:57 | 只看该作者

求助实现一下程序,小弟拜谢,很急。

The algorithm is based on Newton's method for solving the following system for A,
the vector of fitted numbers of cases at each nonzero exposure level. We have an equation
for each observed exposure level,
Lx + log(M1-A+) + log(Nx –Ax)- logAx -log (N0 – M1+A+)= 0,
where A+ is the sum of the elements of A (note that Ao is not in A, since Ao = M1 - A+). An
initial value A(0) may be the crude observed totals, if available, or the null expected value
M1N/n, where N is the vector of Nx for x≠ 0 and n is the total number of subjects in the
data. The algorithm may diverge from poor starting values; in our experience, convergence
was always achieved by starting with the crude observed totals rather than the null expected
values.
At iteration i, define
A0(i)=M1-A+(i)
Cx(i)=1/ Ax(i)+ 1/ (N-Ax(i)) for all x (including x = 0),
ex(i)=Lx+logA0(i)+log(Nx-Ax(i))-logAx(i)-log(N0-A0(i)) for x≠0,
e(i)=the vector of ex(i),
H(i)= the matrix with for Cx(i)+C0(i) for on-diagonal elements and C0(i) for all off-diagonal
elements, and
A(i+1)=A(i)+( H(i))-1 e(i)
Convergence is achieved when the increments become negligible relative to the Ax(i) and
N - Ax(i)  for all x. For person-time data, the equations become
Lx + log(M1- A+) +logNx - logAx – logN0 = 0;
the expression for ex(i)is similarly modified; and Cx(i) becomes 1/Ax(i).
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2026-2-6 06:27 , Processed in 0.166483 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表