stepp.win | R Documentation |

This is the constructor function to create a stepp window object.

```
stepp.win(type = "sliding", r1 = 5, r2 = 20, e1 = NULL, e2 = NULL)
```

`type` |
type of stepp window; "sliding", "sliding_events" or "tail-oriented" |

`r1` |
sliding window: minimum number of patients allowed in overlapping windows; |

`r2` |
sliding window: size of subpopulation in each window; |

`e1` |
sliding window: minimum number of events allowed in overlapping windows |

`e2` |
sliding window: number of events in each subpopulation |

This is the functional interface to construct a stepp window object besides
using new("stwin", ...). A STEPP window specifies a pattern of subpopulation you would like
to explore. There are three kinds of patterns: "sliding window", "event-based sliding window"
and "tail-oriented window".

These patterns are specified through the following set of values (r1 and r2 for sliding and
tail-oriented windows, e1 and e2 for event-based sliding windows):

1. for sliding windows based on the number of patients ("sliding"), r1 is the minimum number
of patients allowed in overlapping windows and r2 is the approximate size of subpopulation
in each window;

2. for sliding windows based on the number of events ("sliding_events"), e1 is the minimum
number of events allowed in overlapping windows and e2 is the approximate size of
subpopulation in each window in terms of number of events;

3. for tail-oriented window, r1 is a vector of maximum covariate value for each subpopulation
from the minimum value of the entire subpopulation, and r2 is a vector of minimum covariate
values for each subpopulation from the maximum value of the window. The utility function,
gen.tailwin, can be used to generate these two vectors based on the number of desired
subpopulations.

When "sliding_events" is chosen r1 and r2 are set to `NULL`

, while when "sliding" or
"tail-oriented" are chosen e1 and e2 are set to `NULL`

.

These pattern are based on all patients.

Wai-ki Yip

`stwin`

, `stsubpop`

, `stmodelKM`

,
`stmodelCI`

, `stmodelGLM`

,
`steppes`

, `stmodel`

,
`stepp.subpop`

, `stepp.KM`

,
`stepp.CI`

, `stepp.GLM`

,
`stepp.test`

, `estimate`

, `generate`

```
# create a stepp window object of type "sliding",
# subpopulation size is 200 and allows only 50 patients
# between overlapping windows
mywin <- stepp.win(type="sliding", r1=50, r2=200)
# print a summary of the stepp window object
summary(mywin)
# create a stepp window object of type "sliding_events",
# (event-based) subpopulation size is 200 and allows
# only 50 events between overlapping windows
mywin <- stepp.win(type="sliding_events", e1=50, e2=200)
# print a summary of the stepp window object
summary(mywin)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.