View source: R/crossTimeCorrelations.R
crossTimeCorrelation | R Documentation |
Calculate the association of a variable across multiple time points.
crossTimeCorrelation(id = "tcid", time = "age", variable, data)
id |
Name of variable indicating the participant ID. |
time |
Name of variable indicating the timepoint. |
variable |
Name of variable to estimate the cross-time correlation. |
data |
Dataframe. |
Calculate the association of a variable across multiple time points. It is especially useful when there are three or more time points.
output of cor.test()
Other correlations:
addText()
,
cor.table()
,
crossTimeCorrelationDF()
,
partialcor.table()
,
vwReg()
# Prepare Data
df <- expand.grid(ID = 1:100, time = c(1, 2, 3))
df <- df[order(df$ID),]
row.names(df) <- NULL
df$score <- rnorm(nrow(df))
# Cross-Time Correlation
crossTimeCorrelation(id = "ID", time = "time", variable = "score", data = df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.