Description Usage Arguments Details Value Author(s) Examples
A function used to match actigraphy data and clinical covariates by subject IDs and return a list of the data combined by IDs. Only the subjects with both actigraphy and covariate data will be returned by this function.
1 | fda.matchid(mat, acov, type, grouplab)
|
mat |
A data frame with the rows being the time and the columns being the activity, with the column names being the subjects. |
acov |
A two column data frame that contains only subject IDs and a covariate of interest, respectively. |
type |
A string specifying either |
grouplab |
A vector of names of the categories if |
Note: Only the subjects with both actigraphy and covariate data will be returned by this function.
A list consisting of two components as follows:
mat |
A matrix where rows represent the time, columns are the samples, and the column names are the subjects. |
cov |
A two column matrix that contains the actigraphy data and clinical covariates. |
William D. Shannon, Tao Li, Hong Xian, Jia Wang, Elena Deych, Carlos Gonzalez
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | data(act_29pt)
data(clinic_29pt_ahi)
data <- act_29pt
ahi <- clinic_29pt_ahi
### Example 1: Continuous Covariate
matchida <- fda.matchid(data, ahi, "contin")
### Example 2: Categorical Covariate
ahi$ahicat <- as.factor(
ifelse(ahi$AHI >= 0 & ahi$AHI <= 5, 1,
ifelse(ahi$AHI > 5 & ahi$AHI <= 15, 2,
ifelse(ahi$AHI > 15 & ahi$AHI <= 30, 3,
ifelse(ahi$AHI > 30, 4, 0))))
)
matchidb <- fda.matchid(data, ahi[,-2], "factor",
c("normal", "mild", "moderate", "severe"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.