Rewriting integration by summation

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

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

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

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

The Nelson-Aalen estimator is given by:

\(\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)}\)
\(\Rightarrow\hat H(t)=\sum_{j:t_j\le t}\frac{d_j}{n_j}\ldots (1)\)

With a hypothetical example, let me show how equation \((1)\) works:

\(
\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}
\)

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

\(
\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}
\)


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

\(\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)\)

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

So I wrote it as

\(\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)}\)
\(\Rightarrow\hat H_w(t)=\sum_{j:t_j\le t}\frac{w_jd_j}{w_jn_j}\ldots (3)\)

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

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