Learn R Programming

WPC (version 1.0)

ns.windows: Create a Series of Overlapping Windows by Fixing Number of Patients within each Window

Description

This function creates a series of overlapping windows by fixing the number of patients within each window.

Usage

ns.windows(event, censor, marker, nsub, sspeed)

Arguments

event
This is the survival time. It is a positive numerical vector with no missing values.
censor
This specifies censor information. It is a vector, with 1 indicating an event and 0 indicating right censored. No missing values are allowed.
marker
This is the biomarker information (or other interesting variables). It is numerical with no missing values.
nsub
This is to specify the fixed number of patients within each window. The smaller the number of patients within each window, the more the overlapping windows are specified.
sspeed
This is to specify the window sliding step. Since the window is gradually moving from small values on the left to the large values on the right. This variable specifies the window sliding step being removed form the left and added on the right, in order to keep the same number of subjects in each window.

Value

A list with components: A list with components:

Details

It begins by ordering all the subjects based on their biomarker values from low to high. Let $x_1, x_2, \dots, x_n$ be the ordered unique values of X observed in the data. Then a series of overlapping windows can be defined using two parameters: $\gamma$ - the number of patients within each window and $\nu$ - the number of patients being rotated out for each moving step. The window is gradually moving from small values on the left to large values on the right, in order to keep the same number of patient in each window. The first window starts from the first subject to the $(\gamma+1)$th subject. The second window will move forward by $\nu$th subjects and including from $(\gamma+\nu+1)$th subject till $(\gamma+2\times\nu)$th subject. This process continues until all subjects have been included in at least one window. Subjects can be included in several windows.

References

Yang H., Tang R., Hale M. and Huang J. (2016) A visualization method measuring the performance of biomarkers for guiding treatment decisions Pharmaceutical Statistics, 15(2), 1539-1612

See Also

ww.windows

Examples

Run this code

	## Window width is specified as 10 and window sliding step is 1:

	object = ns.windows(event=wpcdata$OSday, censor=wpcdata$OScensor, 
	marker=wpcdata$Biomarker1, nsub=10, sspeed=1)
	print(object)

Run the code above in your browser using DataLab