Rewriting integration by summation

#1
Suppose that [math]n[/math] individuals have lifetimes represented by random variables [math]T_1, T_2, \ldots, T_n.[/math] Instead of the observed values for each lifetime, we have a time [math]t_i'[/math] which we know is either the lifetime or censoring time.

Let us define a variable [math]\delta_i=I(T_i=t_i')[/math] that equals [math]1[/math] if [math]T_i=t_i'[/math] and [math]0[/math] if [math]T_i>t_i'[/math]. This [math]\delta_i[/math] is called the censoring or status indicator for [math]t_i'[/math], since it tells us if [math]t_i'[/math] is an observed lifetime [math](\delta_i=1)[/math] or censoring time [math](\delta_i=0).[/math] The observed data then consist of [math](t_i',\delta_i), i=1,2,\ldots n.[/math]

Suppose that there are [math]k[/math] [math](k\le n)[/math] distinct times [math]t_1<t_2<\ldots t_k[/math] at which death occurs. The possibility of there being more than one death at [math]t_j[/math] is allowed, and we let [math]d_j=\sum I(t_i'=t_j,\delta_i=1)[/math] represents the number of deaths at [math]t_j.[/math] In addition to the lifetimes [math]t_1,\ldots, t_k,[/math] there are also censoring times for individuals whose lifetimes are not observed.

Also let [math]n_j=\sum I(t_i'\ge t_j)[/math] is the number of individuals at risk at [math]t_j.[/math]

The Nelson-Aalen estimator is given by:

[math]\hat H(t)=\int_{0}^{t}\frac{dN(u)}{Y(u)}=\int_{0}^{t}\frac{d\sum_{i=1}^{n}N_i(u)}{\sum_{i=1}^{n}Y_i(u)}[/math]
[math]\Rightarrow\hat H(t)=\sum_{j:t_j\le t}\frac{d_j}{n_j}\ldots (1)[/math]

With a hypothetical example, let me show how equation [math](1)[/math] works:

[math]
\begin{array}{l|cccccccccc}
t_i' & 6 & 6 & 6 & 7 & 9 & 10 & 10 & 11 & 13 & 16 \\
\hline
\delta_i & 1 & 1 & 0 & 1 & 0 & 1 & 0 & 0 & 1 & 1\\
\end{array}
[/math]

From the above data, we can calculate [math]\hat H(t)[/math] by following:

[math]
\begin{array}{c|c|c|c}
t_j & n_j & d_j & \hat H(t_j) \\
\hline
6 & 10 & 2 & 0.2 \\
7 & 7 & 1 & 0.343 \\
9 & 6 & 0 & 0.343\\
10 & 5 & 1 & 0.543 \\
11 & 3 & 0 & 0.543\\
13 & 2 & 1 & 1.043\\
16 & 1 & 1 & 2.043
\end{array}
[/math]


Incorporating a weight function [math]w_i(u),i=1,2,\ldots n[/math], the estimator for the cumulative hazard function is

[math]\hat H_w(t)=\int_{0}^{t}\frac{\sum_{i=1}^{n}w_i(u)dN_i(u)}{\sum_{i=1}^{n}w_i(u)Y_i(u)}. \ldots (2)[/math]

Now I want to rewrite [math]\hat H_w(t)[/math] of equation [math](2)[/math] in the representation of summation as like equation [math](1)[/math].

So I wrote it as

[math]\hat H_w(t)=\int_{0}^{t}\frac{\sum_{i=1}^{n}w_i(u)dN_i(u)}{\sum_{i=1}^{n}w_i(u)Y_i(u)}[/math]
[math]\Rightarrow\hat H_w(t)=\sum_{j:t_j\le t}\frac{w_jd_j}{w_jn_j}\ldots (3)[/math]

But in equation [math](3)[/math], [math]w_j[/math] of numerator and denominator cancels out and it reduces to equation [math](1)[/math]. That is, I couldn't correctly rewrite equation [math](2)[/math].

How can I express [math]\hat H_w(t)[/math] of equation [math](2)[/math] in the representation of summation?