Version: | 2.4.0.2 |
Date: | 2022-01-06 |
Title: | Data Processing after Running 'GGIR' for Accelerometer Data |
Maintainer: | Wei Guo <wei.guo3@nih.gov> |
Description: | Generate all necessary R/Rmd/shell files for data processing after running 'GGIR' (v2.4.0) for accelerometer data. In part 1, all csv files in the GGIR output directory were read, transformed and then merged. In part 2, the GGIR output files were checked and summarized in one excel sheet. In part 3, the merged data was cleaned according to the number of valid hours on each night and the number of valid days for each subject. In part 4, the cleaned activity data was imputed by the average Euclidean norm minus one (ENMO) over all the valid days for each subject. Finally, a comprehensive report of data processing was created using Rmarkdown, and the report includes few exploratory plots and multiple commonly used features extracted from minute level actigraphy data. |
URL: | https://github.com/dora201888/postGGIR |
BugReports: | https://github.com/dora201888/postGGIR/issues |
License: | GPL-3 |
Imports: | refund, denseFLMM, dplyr, xlsx, survival, stats, tidyr, zoo, ineq, cosinor, cosinor2, abind, accelerometry, ActCR, ActFrag, minpack.lm, kableExtra, GGIR |
Depends: | R (≥ 3.6.0) |
Suggests: | knitr, rmarkdown |
Encoding: | UTF-8 |
ByteCompile: | true |
Type: | Package |
VignetteBuilder: | knitr |
RoxygenNote: | 7.1.2 |
NeedsCompilation: | no |
Packaged: | 2022-01-06 13:33:20 UTC; guow4 |
Author: | Wei Guo [aut, cre], Andrew Leroux [aut], Vadim Zipunnikov [aut], Kathleen Merikangas [aut] |
Repository: | CRAN |
Date/Publication: | 2022-01-06 14:30:02 UTC |
Cosinor Model for Circadian Rhythmicity
Description
A parametric approach to study circadian rhythmicity assuming cosinor shape.
Usage
ActCosinor2(x, window = 1, n1440 = 1440)
Arguments
x |
|
window |
The calculation needs the window size of the data. E.g window = 1 means each epoch is in one-minute window. |
n1440 |
the number of points of a day. Default is 1440 for the minute-level data. |
Value
A list with elements
mes |
MESOR which is short for midline statistics of rhythm, which is a rhythm adjusted mean. This represents mean activity level. |
amp |
amplitude, a measure of half the extend of predictable variation within a cycle. This represents the highest activity one can achieve. |
acro |
acrophase, a meaure of the time of the overall high values recurring in each cycle. Here it has a unit of radian. This represents time to reach the peak. |
acrotime |
acrophase in the unit of the time (hours) |
ndays |
Number of days modeled |
References
Cornelissen, G. Cosinor-based rhythmometry. Theor Biol Med Model 11, 16 (2014). https://doi.org/10.1186/1742-4682-11-16
Cosinor Model for Circadian Rhythmicity for the Whole Dataset
Description
A parametric approach to study circadian rhythmicity assuming cosinor shape.This function is a whole dataset
wrapper for ActCosinor
.
Usage
ActCosinor_long2(count.data, window = 1)
Arguments
count.data |
|
window |
The calculation needs the window size of the data. E.g window = 1 means each epoch is in one-minute window. |
Value
A data.frame
with the following 5 columns
ID |
ID |
ndays |
number of days |
mes |
MESRO, which is short for midline statistics of rhythm, which is a rhythm adjusted mean. This represents mean activity level. |
amp |
amplitude, a measure of half the extend of predictable variation within a cycle. This represents the highest activity one can achieve. |
acro |
acrophase, a meaure of the time of the overall high values recurring in each cycle. Here it has a unit of radian. This represents time to reach the peak. |
acrotime |
acrophase in the unit of the time (hours) |
ndays |
Number of days modeled |
Extended Cosinor Model for Circadian Rhythmicity
Description
Extended cosinor model based on sigmoidally transformed cosine curve using anti-logistic transformation
Usage
ActExtendCosinor2(
x,
window = 1,
lower = c(0, 0, -1, 0, -3),
upper = c(Inf, Inf, 1, Inf, 27),
n1440 = 1440
)
Arguments
x |
|
window |
The calculation needs the window size of the data. E.g window = 1 means each epoch is in one-minute window. |
lower |
A numeric vector of lower bounds on each of the five parameters (in the order of minimum, amplitude, alpha, beta, acrophase) for the NLS. If not given, the default lower bound for each parameter is set to |
upper |
A numeric vector of upper bounds on each of the five parameters (in the order of minimum, amplitude, alpha, beta, acrophase) for the NLS. If not given, the default lower bound for each parameter is set to |
n1440 |
the number of points of a day. Default is 1440 for the minute-level data. |
Value
A list with elements
minimum |
Minimum value of the of the function. |
amp |
amplitude, a measure of half the extend of predictable variation within a cycle. This represents the highest activity one can achieve. |
alpha |
It determines whether the peaks of the curve are wider than the troughs: when alpha is small, the troughs are narrow and the peaks are wide; when alpha is large, the troughs are wide and the peaks are narrow. |
beta |
It dertermines whether the transformed function rises and falls more steeply than the cosine curve: large values of beta produce curves that are nearly square waves. |
acrotime |
acrophase is the time of day of the peak in the unit of the time (hours) |
F_pseudo |
Measure the improvement of the fit obtained by the non-linear estimation of the transformed cosine model |
UpMesor |
Time of day of switch from low to high activity. Represents the timing of the rest- activity rhythm. Lower (earlier) values indicate increase in activity earlier in the day and suggest a more advanced circadian phase. |
DownMesor |
Time of day of switch from high to low activity. Represents the timing of the rest-activity rhythm. Lower (earlier) values indicate decline in activity earlier in the day, suggesting a more advanced circadian phase. |
MESOR |
A measure analogous to the MESOR of the cosine model (or half the deflection of the curve) can be obtained from mes=min+amp/2. However, it goes through the middle of the peak, and is therefore not equal to the MESOR of the cosine model, which is the mean of the data. |
ndays |
Number of days modeled. |
References
Marler MR, Gehrman P, Martin JL, Ancoli-Israel S. The sigmoidally transformed cosine curve: a mathematical model for circadian rhythms with symmetric non-sinusoidal shapes. Stat Med.
Cosinor Model for Circadian Rhythmicity for the Whole Dataset
Description
Extended cosinor model based on sigmoidally transformed cosine curve using anti-logistic transformation.This function is a whole dataset
wrapper for ActExtendCosinor
.
Usage
ActExtendCosinor_long2(
count.data,
window = 1,
lower = c(0, 0, -1, 0, -3),
upper = c(Inf, Inf, 1, Inf, 27)
)
Arguments
count.data |
|
window |
The calculation needs the window size of the data. E.g window = 1 means each epoch is in one-minute window. window size as an argument. |
lower |
A numeric vector of lower bounds on each of the five parameters (in the order of minimum, amplitude, alpha, beta, acrophase) for the NLS. If not given, the default lower bound for each parameter is set to |
upper |
A numeric vector of upper bounds on each of the five parameters (in the order of minimum, amplitude, alpha, beta, acrophase) for the NLS. If not given, the default lower bound for each parameter is set to |
Value
A data.frame
with the following 5 columns
ID |
ID |
ndays |
number of days |
minimum |
Minimum value of the of the function. |
amp |
amplitude, a measure of half the extend of predictable variation within a cycle. This represents the highest activity one can achieve. |
alpha |
It determines whether the peaks of the curve are wider than the troughs: when alpha is small, the troughs are narrow and the peaks are wide; when alpha is large, the troughs are wide and the peaks are narrow. |
beta |
It dertermines whether the transformed function rises and falls more steeply than the cosine curve: large values of beta produce curves that are nearly square waves. |
acrotime |
acrophase is the time of day of the peak in the unit of the time (hours) |
F_pseudo |
Measure the improvement of the fit obtained by the non-linear estimation of the transformed cosine model |
UpMesor |
Time of day of switch from low to high activity. Represents the timing of the rest- activity rhythm. Lower (earlier) values indicate increase in activity earlier in the day and suggest a more advanced circadian phase. |
DownMesor |
Time of day of switch from high to low activity. Represents the timing of the rest-activity rhythm. Lower (earlier) values indicate decline in activity earlier in the day, suggesting a more advanced circadian phase. |
MESOR |
A measure analogous to the MESOR of the cosine model (or half the deflection of the curve) can be obtained from mes=min+amp/2. However, it goes through the middle of the peak, and is therefore not equal to the MESOR of the cosine model, which is the mean of the data. |
Annotating the merged data for all accelerometer files in the GGIR output
Description
Annotating the merged ENMO/ANGLEZ data by adding some descriptive variables such as number of valid days and missing pattern.
Usage
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
)
Arguments
studyname |
|
outputdir |
|
workdir |
|
QCdays.alpha |
|
QChours.alpha |
|
summaryFN |
|
epochIn |
|
epochOut |
|
useIDs.FN |
|
RemoveDaySleeper |
|
trace |
|
Step |
|
Value
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,
filename |
accelerometer file name |
Date |
date recored from the GGIR part2.summary file |
id |
IDs recored from the GGIR part2.summary file |
calender_date |
date in the format of yyyy-mm-dd |
N.valid.hours |
number of hours with valid data recored from the part2_daysummary.csv file in the GGIR output |
N.hours |
number of hours of measurement recored from the part2_daysummary.csv file in the GGIR output |
weekday |
day of the week-Day of the week |
measurementday |
day of measurement-Day number relative to start of the measurement |
newID |
new IDs defined as the user-defined function of filename2id(), e.g. substrings of the filename |
Nmiss_c9_c31 |
number of NAs from the 9th to 31th column in the part2_daysummary.csv file in the GGIR output |
missing |
"M" indicates missing for an invalid day, and "C" indicates completeness for a valid day |
Ndays |
number of days of measurement |
ith_day |
rank of the measurementday, for example, the value is 1,2,3,4,-3,-2,-1 for measurementday = 1,...,7 |
Nmiss |
number of missing (invalid) days |
Nnonmiss |
number of non-missing (valid) days |
misspattern |
indicators of missing/nonmissing for all measurement days at the subject level |
RowNonWear |
number of columnns in the non-wearing matrix |
NonWearMin |
number of minutes of non-wearing |
Nvalid.day |
number of valid days with/without removing daysleeper nights; It is equal to Nnonmiss when RemoveDaySleeper=FALSE. |
daysleeper |
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). |
remove16h7day |
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. |
duplicate |
If duplicate="remove", the accelerometer files will not be used in the data analysis of part5-7. |
Interdaily Statbility
Description
This function calcualte interdaily stability, a nonparametric metric of circadian rhtymicity
Usage
IS2(x)
Arguments
x |
|
References
Junrui Di et al. Joint and individual representation of domains of physical activity, sleep, and circadian rhythmicity. Statistics in Biosciences.
Interdaily Statbility for the Whole Dataset
Description
This function calcualte interdaily stability, a nonparametric metric
of circadian rhtymicity. This function is a whole dataset
wrapper for IS
Usage
IS_long2(count.data, window = 1, method = c("average", "sum"))
Arguments
count.data |
|
window |
an |
method |
|
Value
A data.frame
with the following 2 columns
ID |
ID |
IS |
IS |
References
Junrui Di et al. Joint and individual representation of domains of physical activity, sleep, and circadian rhythmicity. Statistics in Biosciences.
Intradaily Variability
Description
This function calcualte intradaily variability, a nonparametric metric reprsenting fragmentation of circadian rhtymicity
Usage
IV2(x)
Arguments
x |
|
Value
IV
References
Junrui Di et al. Joint and individual representation of domains of physical activity, sleep, and circadian rhythmicity. Statistics in Biosciences.
Intradaily Variability for the Whole Dataset
Description
This function calcualte intradaily variability, a nonparametric metric
reprsenting fragmentation of circadian rhtymicity. This function is a whole dataset
wrapper for IV
.
Usage
IV_long2(count.data, window = 1, method = c("average", "sum"))
Arguments
count.data |
|
window |
an |
method |
|
Value
A data.frame
with the following 5 columns
ID |
ID |
Day |
Day |
IV |
IV |
References
Junrui Di et al. Joint and individual representation of domains of physical activity, sleep, and circadian rhythmicity. Statistics in Biosciences.
Timne Metrics for Whole Dataset
Description
This function is a whole dataset wrapper for Time
Usage
PAfun(count.data, weartime, PA.threshold = c(50, 100, 400))
Arguments
count.data |
|
weartime |
|
PA.threshold |
threshold to calculate the time in minutes of sedentary, light, moderate and vigorous activity the data. |
Value
A dataframe with some of the following columns
ID |
identifier of the person |
Day |
indicator of which day of activity it is, can be a numeric vector of sequence 1,2,... or a string of date |
time |
time of certain state |
Relative Amplitude
Description
This function calcualte relative amplitude, a nonparametric metric reprsenting fragmentation of circadian rhtymicity
Usage
RA2(x, window = 1, method = c("average", "sum"))
Arguments
x |
|
window |
since the caculation of M10 and L5 depends on the dimension of data, we need to include window size as an argument. |
method |
|
Value
RA
References
Junrui Di et al. Joint and individual representation of domains of physical activity, sleep, and circadian rhythmicity. Statistics in Biosciences.
Relative Amplitude for the Whole Datset
Description
This function calcualte relative amplitude, a nonparametric metric
of circadian rhtymicity. This function is a whole dataset
wrapper for RA
.
Usage
RA_long2(count.data, window = 1, method = c("average", "sum"))
Arguments
count.data |
|
window |
since the caculation of M10 and L5 depends on the dimension of data, we need to include
window size as an argument. This function is a whole dataset
wrapper for |
method |
|
Value
A data.frame
with the following 3 columns
ID |
ID |
Day |
Day |
RA |
RA |
Modified SVDmiss function (package SpatioTemporal)
Description
Modify ncomp = min(ncol(X),nrow(X),ncomp) for the matrix with nrow(X)<ncol(X)
Usage
SVDmiss2(X, niter = 200, ncomp = dim(X)[2], conv.reldiff = 0.001)
Arguments
X |
|
niter |
|
ncomp |
|
conv.reldiff |
|
Details
See SVDmiss(package:SpatioTemporal) for details.
Value
See SpatioTemporal:: SVDmiss for details
Time of A Certain activity State
Description
Calculate the total time of being in certain state, e.g. sedentary, active, MVPA, etc.
Usage
Time2(x, w, thresh, smallerthan = TRUE, bout.length = 1)
Arguments
x |
|
w |
|
thresh |
threshold to binarize the data. |
smallerthan |
Find a state that is smaller than a threshold, or greater than or equal to. |
bout.length |
minimum duration of defining an active bout; defaults to 1. |
Value
Time
Timne Metrics for Whole Dataset
Description
This function is a whole dataset wrapper for Time
Usage
Time_long2(count.data, weartime, thresh, smallerthan = TRUE, bout.length = 1)
Arguments
count.data |
|
weartime |
|
thresh |
threshold to binarize the data. |
smallerthan |
Find a state that is smaller than a threshold, or greater than or equal to. |
bout.length |
minimum duration of defining an active bout; defaults to 1. |
Value
A dataframe with some of the following columns
ID |
identifier of the person |
Day |
indicator of which day of activity it is, can be a numeric vector of sequence 1,2,... or a string of date |
time |
time of certain state |
Total Volumen of Activity for Whole Dataset
Description
Calculate total volume of activity level, which includes
TLAC
(total log transfored activity counts),
TAC
(total activity counts).
Usage
Tvol2(count.data, weartime, logtransform = FALSE, log.multiplier = 9250)
Arguments
count.data |
|
weartime |
|
logtransform |
if |
log.multiplier |
|
Details
log transormation is defined as log(x+1).
Value
A dataframe with some of the following columns
ID |
identifier of the person |
Day |
indicator of which day of activity it is, can be a numeric vector of sequence 1,2,... or a string of date |
TAC |
total activity count |
TLAC |
total log activity count |
Main Call for Data Processing after Runing GGIR for Accelerometer Data
Description
This R script will generate all necessary R/Rmd/shell files for data processing after running GGIR for accelerometer data.
Usage
afterggir(
mode,
useIDs.FN = NULL,
currentdir,
studyname,
bindir = NULL,
outputdir,
epochIn = 5,
epochOut = 5,
flag.epochOut = 60,
log.multiplier = 9250,
use.cluster = TRUE,
QCdays.alpha = 7,
QChours.alpha = 16,
QCnights.feature.alpha = c(0, 0),
Rversion = "R",
filename2id = NULL,
PA.threshold = c(50, 100, 400),
desiredtz = "US/Eastern",
RemoveDaySleeper = FALSE,
part5FN = "WW_L50M100V400_T5A5",
NfileEachBundle = 20,
trace = FALSE
)
Arguments
mode |
|
useIDs.FN |
|
currentdir |
|
studyname |
|
bindir |
|
outputdir |
|
epochIn |
|
epochOut |
|
flag.epochOut |
|
log.multiplier |
|
use.cluster |
|
QCdays.alpha |
|
QChours.alpha |
|
QCnights.feature.alpha |
|
Rversion |
|
filename2id |
|
PA.threshold |
|
desiredtz |
|
RemoveDaySleeper |
|
part5FN |
|
NfileEachBundle |
|
trace |
|
Value
See postGGIR manual for details.
Bin data into longer windows
Description
Bin minute level data into different time resolutions
Usage
bin_data2(x = x, window = 1, method = c("average", "sum"))
Arguments
x |
|
window |
window size used to bin the original 1440 dimensional data into. Window size should be an integer factor of 1440 |
method |
|
Value
a vector of binned data
Create a template shell script of postGGIR
Description
Create a template shell script of postGGIR, named as STUDYNAME_part0.maincall.R.
Usage
create.postGGIR()
Value
The function will create a template shell script of postGGIR in the current directory, names as STUDYNAME_part0.maincall.R
Data imputation for the cleaned data with annotation
Description
Data imputation for the merged ENMO data with annotation. The missing values were imputated by the average ENMO over all the valid days for each subject.
Usage
data.imputation(workdir, csvInput)
Arguments
workdir |
|
csvInput |
|
Value
Files were written to the specified sub-directory, named as impu.flag_All_studyname_ENMO.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,
filename |
accelerometer file name |
Date |
date recored from the GGIR part2.summary file |
id |
IDs recored from the GGIR part2.summary file |
calender_date |
date in the format of yyyy-mm-dd |
N.valid.hours |
number of hours with valid data recored from the part2_daysummary.csv file in the GGIR output |
N.hours |
number of hours of measurement recored from the part2_daysummary.csv file in the GGIR output |
weekday |
day of the week-Day of the week |
measurementday |
day of measurement-Day number relative to start of the measurement |
newID |
new IDs defined as the user-defined function of filename2id(), e.g. substrings of the filename |
Nmiss_c9_c31 |
number of NAs from the 9th to 31th column in the part2_daysummary.csv file in the GGIR output |
missing |
"M" indicates missing for an invalid day, and "C" indicates completeness for a valid day |
Ndays |
number of days of measurement |
ith_day |
rank of the measurementday, for example, the value is 1,2,3,4,-3,-2,-1 for measurementday = 1,...,7 |
Nmiss |
number of missing (invalid) days |
Nnonmiss |
number of non-missing (valid) days |
misspattern |
indicators of missing/nonmissing for all measurement days at the subject level |
RowNonWear |
number of columnns in the non-wearing matrix |
NonWearMin |
number of minutes of non-wearing |
daysleeper |
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). |
remove16h7day |
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. |
duplicate |
If duplicate="remove", the accelerometer files will not be used in the data analysis of part5. |
ImpuMiss.b |
number of missing values on the ENMO data before imputation |
ImpuMiss.a |
number of missing values on the ENMO data after imputation |
KEEP |
The value is "keep"/"remove", e.g. KEEP="remove" if remove16h7day=1 or duplicate="remove" or ImpuMiss.a>0 |
Fragmentation Metrics
Description
Fragmentation methods to study the transition between two states, e.g. sedentary v.s. active.
Usage
fragmentation2(
x,
w,
thresh,
bout.length = 1,
metrics = c("mean_bout", "TP", "Gini", "power", "hazard", "all")
)
Arguments
x |
|
w |
|
thresh |
threshold to binarize the data. |
bout.length |
minimum duration of defining an active bout; defaults to 1. |
metrics |
What is the fragmentation metrics to exract. Can be "mean_bout","TP","Gini","power","hazard",or all the above metrics "all". |
Details
Metrics include mean_bout (mean bout duration), TP (between states transition probability), Gini (gini index), power (alapha parameter for power law distribution) hazard (average hazard function)
Value
A list with elements
mean_r |
mean sedentary bout duration |
mean_a |
mean active bout duration |
SATP |
sedentary to active transition probability |
ASTP |
bactive to sedentary transition probability |
Gini_r |
Gini index for active bout |
Gini_a |
Gini index for sedentary bout |
h_r |
hazard function for sedentary bout |
h_a |
hazard function for active bout |
alpha_r |
power law parameter for sedentary bout |
alpha_a |
power law parameter for active bout |
References
Junrui Di, Andrew Leroux, Jacek Urbanek, Ravi Varadhan, Adam P. Spira, Jennifer Schrack, Vadim Zipunnikov. Patterns of sedentary and active time accumulation are associated with mortality in US adults: The NHANES study. bioRxiv 182337; doi: https://doi.org/10.1101/182337
Fragmentation Metrics for Whole Dataset
Description
Fragmentation methods to study the transition between two states, e.g.
sedentary v.s. active.This function is a whole dataset wrapper for fragmentation
Usage
fragmentation_long2(
count.data,
weartime,
thresh,
bout.length = 1,
metrics = c("mean_bout", "TP", "Gini", "power", "hazard", "all"),
by = c("day", "subject")
)
Arguments
count.data |
|
weartime |
|
thresh |
threshold to define the two states. |
bout.length |
minimum duration of defining an active bout; defaults to 1. |
metrics |
What is the fragmentation metrics to exract. Can be "mean_bout","TP","Gini","power","hazard",or all the above metrics "all". |
by |
Determine whether fragmentation is calcualted by day or by subjects (i.e. aggregate bouts across days). by-subject is recommended to gain more power. |
Details
Metrics include mean_bout (mean bout duration), TP (between states transition probability), Gini (gini index), power (alapha parameter for power law distribution) hazard (average hazard function)
Value
A dataframe with some of the following columns
ID |
identifier of the person |
Day |
|
mean_r |
mean sedentary bout duration |
mean_a |
mean active bout duration |
SATP |
sedentary to active transition probability |
ASTP |
bactive to sedentary transition probability |
Gini_r |
Gini index for active bout |
Gini_a |
Gini index for sedentary bout |
h_r |
hazard function for sedentary bout |
h_a |
hazard function for active bout |
alpha_r |
power law parameter for sedentary bout |
alpha_a |
power law parameter for active bout |
Transform the data and merge all accelerometer files in the GGIR output
Description
An accelerometer file was transformed into wide data matrix, in which the rows represent available days and the columns including all timestamps for 24 hours. Further, the wide data was merged together.
Usage
ggir.datatransform(
outputdir,
subdir,
studyname,
numericID = FALSE,
sortByid = "newID",
f0 = 1,
f1 = 1e+06,
epochIn = 5,
epochOut = 600,
mergeVar = 1
)
Arguments
outputdir |
|
subdir |
|
studyname |
|
numericID |
|
sortByid |
|
f0 |
|
f1 |
|
epochIn |
|
epochOut |
|
mergeVar |
|
Value
mergeVar = 1 |
Six files were written to the specified sub-directory as follows, |
nonwearscore_studyname_f0_f1_Xs.xlsx |
Data matrix of nonwearscore, where f0 and f1 are the file index to start and finish with and Xs is the epoch size to which acceleration was averaged (seconds) in GGIR output. |
clippingscore_studyname_f0_f1_Xs.xlsx |
Data matrix of clippingscore |
lightmean_studyname_f0_f1_Xs.xlsx |
Data matrix of lightmean |
lightpeak_studyname_f0_f1_Xs.xlsx |
Data matrix of lightpeak |
temperaturemean_studyname_f0_f1_Xs.xlsx |
Data matrix of temperaturemean |
EN_studyname_f0_f1_Xs.xlsx |
Data matrix of EN |
mergeVar = 2 |
Two files were written to the specified sub-directory as follows, |
studyname_ENMO.dataf0_f1_Xs.xlsx |
Data matrix of ENMO, where f0 and f1 are the file index to start and finish with and Xs is the epoch size to which acceleration was averaged (seconds) in GGIR output. |
studyname_ANGLEZ.dataf0_f1_Xs.xlsx |
Data matrix of ANGLEZ |
Description of all accelerometer files in the GGIR output
Description
Description of all accelerometer files in the GGIR output and this script was executed when mode=2 in the main call.
Usage
ggir.summary(
bindir = NULL,
outputdir,
studyname,
numericID = FALSE,
sortByid = "filename",
subdir = "summary",
part5FN = "WW_L50M125V500_T5A5",
QChours.alpha = 16,
filename2id = NULL,
desiredtz = "US/Eastern",
trace = FALSE
)
Arguments
bindir |
|
outputdir |
|
studyname |
|
numericID |
|
sortByid |
|
subdir |
|
part5FN |
|
QChours.alpha |
|
filename2id |
|
desiredtz |
|
trace |
|
Value
Four files were written to the specified sub-directory
studyname_ggir_output_summary.xlsx |
This excel file includs 9 pages as follows, |
page 1 |
List of files in the GGIR output |
page 2 |
Summary of files |
page 3 |
List of duplicate IDs |
page 4 |
ID errors |
page 5 |
Number of valid days |
page 6 |
Table of number of valid/missing days |
page 7 |
Missing patten |
page 8 |
Frequency of the missing pattern |
page 9 |
Description of all accelerometer files |
page 10 |
Inspects accelerometer file for key information, including: monitor brand, sample frequency and file header |
studyname_ggir_output_summary_plot.pdf |
Some plots such as the number of valid days, which were included in the part2a_studyname_postGGIR.report.html file as well. |
part24daysummary.info.csv |
Intermediate results for description of each accelerometer file. |
studyname_samples_remove_temp.csv |
Create studyname_samples_remove.csv file by filling "remove" in the "duplicate" column in this template. If duplicate="remove", the accelerometer files will not be used in the data analysis of part 5-7. |
Modified jive.predict function (package: r.jive)
Description
Replace SVDmiss by SVDmiss2 in the function
Usage
jive.predict2(data.new, jive.output)
Arguments
data.new |
|
jive.output |
|
Details
See jive.predict(package:r.jive) for details.
Value
See r.jive:: jive.predict for details
View phenotype variables
Description
This R script will generate plot for each variable and write description to a log file.
Usage
pheno.plot(
inputFN,
outFN = paste("plot_", inputFN, ".pdf", sep = ""),
csv = TRUE,
sep = " ",
start = 3,
read = TRUE,
logFN = NULL,
track = TRUE
)
Arguments
inputFN |
|
outFN |
|
csv |
|
sep |
|
start |
|
read |
|
logFN |
|
track |
|
Value
Files were written to the current directory. One is .pdf file for plots and the other is .log file for variable description.
Create Wear/Nonwear Flags
Description
Determine during which time period, subject should wear the device. It is preferable that user provide their own wear/non wear flag which should has the same dimension as the activity data. This function provide wear/non wear flag based on time of day.
Usage
wear_flag(count.data, start = "05:00", end = "23:00")
Arguments
count.data |
|
start |
start time, a string in the format of 24hr, e.g. "05:00"; defaults to "05:00". |
end |
end time, a string in the format of 24hr, e.g. "23:00"; defaults to "23:00" |
Details
Fragmentation metrics are usually defined when subject is awake. The weartime
provide time periods on which those features should be extracted.
This can be also used as indication of wake/sleep.
Value
A data.frame
with same dimension and column name as the count.data
, with 0/1 as the elments
reprensting wear, nonwear respectively.