no_in_caliper: Count the number of previous observation in caliper over time

Description Usage Arguments Details Value

View source: R/viz_no_in_caliper.R

Description

Counts the number (or percentage) of previous observations within a specific caliper with over time.

Usage

1
no_in_caliper(cw, df, first_t, percentage)

Arguments

cw

Caliper width value.

df

Data frame containing the pooling variables and time. The first column needs to be called "t" and contain the timepoint. It needs to be an unbroken sequence of integers. The rest of the columns should be continuous pooling variables (local?).

first_t

Timepoint ("t") from which to start counting. Needs to be greater than the smallest "t"-value in df.

percentage

Should the number of observations within the caliper (FALSE) or the percentage within (TRUE) be returned?

Details

Details go here.

Value

A data.frame with columns count (numer of observation within caliper), cw_val (caliper width), and time (time point).


ooelrich/oscbvar documentation built on Sept. 8, 2021, 3:31 p.m.