crossTimeCorrelationDF {petersenlab}R Documentation

Cross-Time Correlations Dataframe.

Description

Dataframe used to compute cross-time correlations.

Usage

crossTimeCorrelationDF(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

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

Value

dataframe with three columns in the form of: ID, time1, time2

See Also

Other correlations: addText(), cor.table(), crossTimeCorrelation(), 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
crossTimeCorrelationDF(id = "ID", time = "time", variable = "score", data = df)

[Package petersenlab version 1.0.0 Index]