Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Representing Visits With Counting Processes

Informative Observation Schedules · Tutorial 34 of 697

Representing Visits With Counting Processes

Learn to express visit times, follow-up, and visit rates with counting-process notation while avoiding incorrect rate calculations at entry and exit boundaries.

Advanced 12 min read

What You'll Learn

  • Define a visit counting process and describe its jumps and event history.
  • Specify at-risk intervals and relate them to observed follow-up.
  • Interpret visit intensity as a conditional rate per unit time.
  • Use integrated intensity to express expected visit counts over follow-up.
  • Distinguish an intensity model from a constant-rate summary or a Poisson assumption.
  • Identify why pointwise small-interval approximations require care at risk-interval boundaries.

Why Represent Visits as a Process?

In longitudinal follow-up, patients can have different numbers of visits, and their visits can occur at irregular times. A list of visit times records when measurements were taken, but counting-process notation gives a compact way to describe how the observed visit history accumulates during follow-up. It also distinguishes times when a patient is under observation from times outside the observation interval.

This representation is useful because a visit rate is not just a count divided by total study duration. The relevant rate can vary with time and with the patient’s observed history. A counting process makes the visit events and the time during which they could be observed explicit, without assuming that visits occur at a constant rate or that their timing is unrelated to the patient’s history.

Definition: For patient \(i\), let \(V_{i1},V_{i2},\ldots\) be the times of observed visits, ordered in time. The visit counting process is $$ N_i^V(t)=\sum_j I(V_{ij}\le t), $$ where \(I(\cdot)\) is 1 when its condition is true and 0 otherwise. Thus \(N_i^V(t)\) is the number of visits recorded by time \(t\). At a visit time, the process increases by one; between visits, it is constant.

If a patient has visits at times 1.2, 2.0, and 2.7 months, then \(N_i^V(t)=0\) before 1.2 months, equals 1 from the first visit until the second, equals 2 until the third, and equals 3 afterward. The process is nondecreasing and integer-valued. For a simple visit process, no two visits occur at exactly the same instant, so each jump is one. The visit history through time \(t\) includes the observed jump times up to \(t\), or, equivalently, the path of \(N_i^V(s)\) for \(s\le t\).

Follow-Up and the At-Risk Interval

Let \(L_i\) denote the start of patient \(i\)’s observable follow-up and \(C_i\) the end of that follow-up. A patient contributes time to the visit process only while visits could be recorded under the study’s observation system. A convenient convention is to count visits in \((L_i,C_i]\). The associated at-risk indicator is $$ Y_i(t)=I(L_i<t\le C_i). $$ It indicates whether the patient is under observation at time \(t\) under this endpoint convention. The treatment of a visit exactly at entry or exit should follow the study protocol; the displayed convention is one explicit choice.

Intensity calculations use time integrals. The values assigned to an at-risk indicator at isolated endpoints do not change an integral with respect to time, because single time points have zero duration. However, endpoint conventions do matter when deciding whether a recorded event at that exact time belongs in the data. State that rule separately rather than relying on an intensity formula to decide it.

Worked Example: Reading a Visit Counting Process

Suppose a hypothetical patient enters observable follow-up at \(L_i=1.0\) month, has visits at 1.2, 2.0, and 2.7 months, and leaves follow-up at \(C_i=3.4\) months. Visits are counted using \((L_i,C_i]\).

At \(t=1.1\), no visit has occurred, so \(N_i^V(1.1)=0\). At \(t=2.1\), two visits have occurred, so \(N_i^V(2.1)=2\). At \(t=3.0\), \(N_i^V(3.0)=3\). The total observed visit count by the end of follow-up is \(N_i^V(3.4)=3\), and the at-risk indicator is 1 for times strictly after 1.0 through 3.4 months under the stated convention.

The time from 1.0 to 3.4 months is 2.4 months of observable follow-up. This does not mean that visits occurred at a constant rate within that interval; the process only tells us when its jumps occurred.

Visit Intensity and Integrated Intensity

A visit intensity describes the instantaneous rate of visit occurrence conditional on the observed history just before time \(t\). Write \(\mathcal{F}_{i,t-}\) for the information available for patient \(i\) immediately before \(t\), including the prior visit history and other observed information specified by the model. When the patient is at risk, denote the visit intensity by \(\lambda_i^V(t\mid\mathcal{F}_{i,t-})\). Its units are visits per unit of time. It is a conditional rate, not a probability and not necessarily a constant over follow-up.

Definition: The integrated at-risk intensity over an interval \((a,b]\) is $$ A_i^V(a,b)=\int_a^b Y_i(s)\lambda_i^V(s\mid\mathcal{F}_{i,s-})\,ds. $$ Under the usual counting-process intensity conditions, the compensated process $$ M_i^V(t)=N_i^V(t)-\int_0^t Y_i(s)\lambda_i^V(s\mid\mathcal{F}_{i,s-})\,ds $$ is a martingale (or local martingale under weaker integrability conditions) with respect to the specified history. In particular, when the increments are integrable, the conditional expected number of visits in \((a,b]\), given \(\mathcal{F}_{i,a}\), equals the conditional expectation of the integrated at-risk intensity over that interval.

The conditional expectation statement follows directly from the martingale property: \(E[M_i^V(b)-M_i^V(a)\mid\mathcal{F}_{i,a}]=0\). Substituting the definition of \(M_i^V\) and rearranging gives $$ E[N_i^V(b)-N_i^V(a)\mid\mathcal{F}_{i,a}] = E\left[\int_a^b Y_i(s)\lambda_i^V(s\mid\mathcal{F}_{i,s-})\,ds\ \middle|\ \mathcal{F}_{i,a}\right]. $$ The right-hand side is generally an expectation because future intensity can depend on history that has not yet been observed at time \(a\). It is not generally correct to replace it with an integral of a future, random intensity as if that entire path were already known at \(a\).

At times strictly inside a risk interval, a familiar local approximation can also be used under suitable regularity conditions. If the patient is at risk throughout a sufficiently short interval after \(t\), the intensity is locally well behaved, and the process is simple with negligible probability of multiple jumps in that short interval, then $$ P\{N_i^V(t+h)-N_i^V(t)=1\mid\mathcal{F}_{i,t-}\} = \lambda_i^V(t\mid\mathcal{F}_{i,t-})h+o(h). $$ This is a local statement away from changes in risk status; it is not an endpoint formula. In general, the integrated at-risk intensity is the appropriate expression across an interval that may contain entry or exit.

Worked Example: Integrating a Piecewise Visit Intensity

Consider a hypothetical patient whose observable follow-up runs from month 2 to month 5. Suppose the visit intensity is specified as 0.20 visits per month from month 2 to month 3, 0.50 visits per month from month 3 to month 4, and 0.10 visits per month from month 4 to month 5. Assume these rates define an integrable intensity for the observed visit process over this follow-up.

The integrated at-risk intensity over the full interval is the sum of rate multiplied by duration in each segment: $$ A_i^V(2,5) =(0.20)(3-2)+(0.50)(4-3)+(0.10)(5-4) =0.20+0.50+0.10 =0.80. $$ The units cancel to give an expected number of visits. Under the stated intensity conditions, the expected number of visits over these three months is 0.80. This does not say that the patient will have 0.80 visits, nor does it by itself give the probability of having no visits. An intensity specification alone does not imply a Poisson process.

Boundary Care, Assumptions, and a Short Justification

The intensity representation requires a well-defined observed history, an agreed rule for which visits are counted, and a rate that is nonnegative and integrable over the at-risk time. The process should be adapted to the history being modeled: whether a visit has occurred by time \(t\) must not depend on information from after \(t\). For the usual martingale interpretation, the intensity must describe the conditional event rate relative to that history and the resulting increments must satisfy the relevant integrability conditions.

A common mistake is to apply the interior local approximation at an entry or exit boundary. For example, at entry \(t=L_i\), the expression \(Y_i(t)\lambda_i^V(t)h\) can be zero under the convention \(Y_i(t)=I(L_i<t\le C_i)\), even though visits can occur during \((L_i,L_i+h]\). At exit \(t=C_i\), a pointwise convention might instead leave a positive leading term even though the patient has no observed follow-up after \(C_i\). Neither result is a sound general endpoint approximation.

Key correction: Use a pointwise small-\(h\) expansion only when risk status is locally constant across the interval and the intensity meets the needed regularity conditions. For intervals that include entry or exit, use the integrated at-risk intensity \(\int_a^b Y_i(s)\lambda_i^V(s\mid\mathcal{F}_{i,s-})\,ds\). Endpoint values in that integral do not create follow-up time, while the protocol determines how visits exactly at the endpoints are counted.

To see why integration resolves the boundary issue, consider an interval beginning before entry and ending after entry. The risk indicator is zero before entry and one during the portion of the interval when the patient is observed. Therefore the accumulated rate is contributed only by that observed portion. If the patient enters at \(L_i\), for example, the contribution from \((a,b]\) is the integral over the overlap of \((a,b]\) with the at-risk interval, not the value of the indicator at the single instant \(a\), \(b\), or \(L_i\). This is the appropriate way to relate risk time to expected counts across a boundary.

What the Representation Does—and Does Not—Tell Us

Counting-process notation is more flexible than a single visit count or an average visits-per-month summary. It preserves the ordering and timing of visits and allows the rate to vary over follow-up. A basic total rate, such as total visits divided by total observed person-time, can be a useful descriptive summary, but it averages over time and patients. It does not encode a changing conditional intensity.

A fixed-visit schedule is often simpler to describe with visit indicators at prespecified times. A counting process is more natural when visit times are irregular or the number of visits varies, because each visit is represented as a jump at its actual time. Conversely, reducing data from a planned schedule to a continuous-time process may obscure the design’s discrete structure. The representation should match how observations could occur and be recorded.

The counting process itself is descriptive bookkeeping; it does not explain why visits occurred. A specified intensity may condition on prior observed history, but the notation alone neither determines which history variables belong in a model nor establishes that the modeled rate is appropriate. It also does not resolve measurement error, unrecorded visits, or ambiguity in the definition of follow-up. In practice, check that visit dates are ordered, event counts increase by the number of recorded visits, the risk interval matches observation records, and no modeled intensity is applied outside time at risk.

Worked Example: A Crude Rate Versus the Process History

In a hypothetical dataset, patient A is observed from month 0 through month 4 and has visits at months 1 and 3. Patient B is observed from month 1 through month 4 and has a visit at month 2. Using these intervals, the combined observed time is \(4+3=7\) person-months and the combined visit count is \(2+1=3\).

The pooled descriptive rate is $$ \frac{3\text{ visits}}{7\text{ person-months}}=0.429\text{ visits per person-month}. $$ This rate summarizes the whole dataset, but it hides the distinct visit histories. For example, by month 2, A has one visit and B has one visit, while at month 2.5 neither has yet had A’s second visit at month 3. A counting-process representation retains those event times and each patient’s time at risk; the pooled rate alone does not. The calculated rate is descriptive and does not establish that either patient’s conditional intensity was constant.

Common Pitfalls

  • Treating an intensity as a probability. A rate of 0.2 visits per month is not a 20% probability of a visit in a month. A probability over a specified interval depends on the process assumptions and the interval’s accumulated intensity.
  • Ignoring the at-risk interval. Time before entry or after follow-up ends must not contribute to observed visit exposure.
  • Using an endpoint value as an interval rate. At entry and exit, the at-risk indicator can change. Use the integrated at-risk intensity across such intervals rather than an unqualified pointwise approximation.
  • Assuming a Poisson process from an intensity alone. The intensity specifies a conditional rate, not independent increments or a Poisson distribution for counts.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A patient has visits at months 0.5 and 2.0 after study time begins. What are \(N_i^V(1)\) and \(N_i^V(2.0)\)?
  2. Follow-up is observed from month 3 to month 6, with a constant intensity of 0.4 visits per month while at risk. What is the integrated at-risk intensity over follow-up?
  3. Why should a local small-interval approximation not be applied automatically at the time of entry?
  4. Does specifying an intensity of 0.4 visits per month imply a 40% probability of at least one visit in a month? Explain.

Solutions. (1) \(N_i^V(1)=1\), because the first visit has occurred; \(N_i^V(2.0)=2\), including the visit at month 2.0 under the stated inclusive counting convention. (2) The interval has duration 3 months, so the integrated intensity is \((0.4)(6-3)=1.2\) expected visits under the intensity conditions. (3) Risk status changes at entry, so its value at the boundary may not represent risk during the interval just after entry. The integrated at-risk intensity accounts for the portion of time actually under observation. (4) No. Intensity is a conditional rate, not a probability; a probability requires further specification of the visit process and interval, and an intensity alone does not imply a Poisson model.

Clinical Biostats