missing.rate {accelmissing} | R Documentation |
Computing Missing Rate
Description
Computes the missing rate from acceleromater data.
Usage
missing.rate(label, flag, mark.missing = 0, time.range = c("09:00", "20:59"))
Arguments
label |
an N by 2 matrix including the labels corresponding to |
flag |
an N by T matrix with the values of either 1 or 0 which indicating wearing or missing. This matrix can be created from |
mark.missing |
If |
time.range |
Define the time range during which the missing rate is computed. Default is 9am-9pm, coded by |
Value
Numeric value of a missing rate between 0 to 1. The output is a list of
total |
total missing rate during the time range |
table |
missing rate on days by subject |
table.wh |
wearing hours on days by subject |
label |
wearing hours by subject id and day, same information as table.wh but different data frame |
Author(s)
Jung Ae Lee <jungaeleeb@gmail.com>
References
[1] Lee JA, Gill J (2016). Missing value imputation for physical activity data measured by accelerometer. Statistical Methods in Medical Research.
See Also
Examples
## missing rate calculation: uncomment and run the code below
# data(acceldata); attach(acceldata)
# missing.rate(label, flag, mark.missing=0, time.range=c("09:00", "20:59"))$total
## create missing flag by 60 min criterion
# flag60 = create.flag(PA, window=60, mark.missing=0)
# mr = missing.rate(label, flag60, mark.missing=0, time.range=c("09:00", "20:59"))
# mr$total #28.1 percent
## missing proportion by days
# mean(mr$table < 0.1) # 45.8 percent