Select the subjects that have at least 3 complete days (or other criteria). By such criteria, some complete days are dropped if one has only one or two completed days, although some incomplete days are included if the subject has already three or more complete days.
A list with three data matrix objects, PA, label, and flag, from the initial dataset before any filtering. Check these objects by typing ls(data1).
data2
A list with three data matrix objects, PA, label, and flag, from the output of valid.days(). Check these objects by typing ls(data2).
valid.days
Minimum number of complete days that the subject should have. valid.days=3 is default.
valid.week.days
Minimum number of complete weekdays that the subject should have.
valid.weekend.days
Minimum number of complete weekend days that the subject should have.
mark.missing
If mark.missing = 0 (default), the nonwearing time is marked by 0 while the wearing time is marked by 1 in flag matrix. If mark.missing = 1, it is the opposite.
Value
List with the updated PA, label and flag matrix objects.
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
valid.days
Examples
data(acceldata); attach(acceldata) # read original data
# filtering data for valid days
valid.days.out = valid.days(PA, label, flag, wear.hr=8, time.range=c("09:00","20:59"))
ls(valid.days.out)
# filtering data for valid subjects
x1 = list(PA=PA, label=label, flag=flag) # original data
x2 = valid.days.out # output of valid.days()
valid.sub.out = valid.subjects(data1=x1, data2=x2, valid.days=3)
ls(valid.sub.out)