View source: R/calc_change_cumu.R
calc_change_cumu | R Documentation |
Calculate Cumulative Change at a SET
calc_change_cumu(dat)
dat |
a data frame with one row per pin reading, and the following columns, named exactly: date, set_id, arm_position, pin_number, pin_height |
a list of three tibbles: one each for pin, arm, and set level calculations. Pin level change is calculated first, as the difference between a pin reading and the reading from the earliest date at that set_id–arm–pin. If the first reading was NA, the entire pin's cumulative readings will be NA. The column name in the $pin tibble is "cumu". For every date of a pin reading, this calculated value will exist. On the first date, it is 0. Cumulative pin changes are then averaged to the arm position level on each date, excluding NAs. St Deviation and St Error are also calculated. There is one calculated value for every arm on every reading date. These columns in the $arm tibble are "mean_cumu", "sd_cumu", and "se_cumu". The cumulative arm changes are then averaged to the SET level, also with st dev and st err. There is one calculated value for every SET on every reading date. The columns in the $set tibble are again "mean_cumu", "sd_cumu", and "se_cumu".
calc_change_cumu(example_sets)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.