valid.subjects {accelmissing} | R Documentation |
Include or Exclude Subjects by Criteria
Description
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.
Usage
valid.subjects(data1, data2, valid.days = 3, valid.week.days = NA,
valid.weekend.days = NA, mark.missing = 0, keep.7days=TRUE)
Arguments
data1 |
A list with three data matrix objects, |
data2 |
A list with three data matrix objects, |
valid.days |
Minimum number of complete days that the subject should have. |
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 |
keep.7days |
If |
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
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)