crossTimeCorrelation {petersenlab}R Documentation

Cross-Time Correlations.

Description

Calculate the association of a variable across multiple time points.

Usage

crossTimeCorrelation(id = "tcid", time = "age", variable, data)

Arguments

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.

Details

Calculate the association of a variable across multiple time points. It is especially useful when there are three or more time points.

Value

output of cor.test()

See Also

Other correlations: addText(), cor.table(), crossTimeCorrelationDF(), partialcor.table(), vwReg()

Examples

# 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)

[Package petersenlab version 1.0.0 Index]