Annotating the merged ENMO/ANGLEZ data by adding some descriptive variables such as number of valid days and missing pattern.
DataShrink(
studyname,
outputdir,
workdir,
QCdays.alpha = 7,
QChours.alpha = 16,
summaryFN = "../summary/part24daysummary.info.csv",
epochIn = 5,
epochOut = 60,
useIDs.FN = NULL,
RemoveDaySleeper = FALSE,
trace = FALSE,
Step = 1
)
character
Specify the study name that used in the output file names
character
Directory where the GGIR output was stored.
character
Directory where the output needs to be stored. Note that this directory must exist.
number
Minimum required number of valid days in subject specific analysis as a quality control step in part2. Default is 7 days.
number
Minimum required number of valid hours in day specific analysis as a quality control step in part2. Default is 16 hours.
character
Filename with or without directory for sample information in CSV format, which includes summary description of each accelerometer file. Some description will be extracted and merged into the ENMO/ANGLEZ data.
number
Epoch size to which acceleration was averaged (seconds) in GGIR output. Defaut is 5 seconds.
number
Epoch size to which acceleration was averaged (seconds) in part1. Defaut is 60 seconds.
character
Filename with or without directory for sample information in CSV format, which inclues "filename" and "duplicate" in the headlines at least. If duplicate="remove", the accelerometer files will not be used in the data analysis of part 5-7. Defaut is NULL, which makes all accelerometer files will be used in part 5-7.
logical
Specify if the daysleeper nights are removed from the calculation of number of valid days for each subject. Default is FALSE.
logical
Specify if the intermediate results is printed when the function was executed. Default is FALSE.
number
Specify which of the varaible need to be cleaned. For example, Step = 1 for the "anglez" variable, and Step = 2 for the "enmo" variable.
Files were written to the specified sub-directory, named as flag_ALL_studyname_ENMO.data.Xs.csv and flag_ALL_studyname_ANGLEZ.data.Xs.csv, which Xs is the epoch size to which acceleration was averaged (seconds) in GGIR output. This excel file includs the following columns,
accelerometer file name
date recored from the GGIR part2.summary file
IDs recored from the GGIR part2.summary file
date in the format of yyyy-mm-dd
number of hours with valid data recored from the part2_daysummary.csv file in the GGIR output
number of hours of measurement recored from the part2_daysummary.csv file in the GGIR output
day of the week-Day of the week
day of measurement-Day number relative to start of the measurement
new IDs defined as the user-defined function of filename2id(), e.g. substrings of the filename
number of NAs from the 9th to 31th column in the part2_daysummary.csv file in the GGIR output
"M" indicates missing for an invalid day, and "C" indicates completeness for a valid day
number of days of measurement
rank of the measurementday, for example, the value is 1,2,3,4,-3,-2,-1 for measurementday = 1,...,7
number of missing (invalid) days
number of non-missing (valid) days
indicators of missing/nonmissing for all measurement days at the subject level
number of columnns in the non-wearing matrix
number of minutes of non-wearing
number of valid days with/without removing daysleeper nights; It is equal to Nnonmiss when RemoveDaySleeper=FALSE.
If 0 then the person is a nightsleeper (sleep period did not overlap with noon) if value=1 then the person is a daysleeper (sleep period did overlap with noon).
indicator of a key qulity control output. If remove16h7day=1, the day need to be removed. If remove16h7day=0, the day need to be kept.
If duplicate="remove", the accelerometer files will not be used in the data analysis of part5-7.