adjust_target {crosslag}R Documentation

Title Generate covariates' residuals

Description

Title Generate covariates' residuals

Usage

adjust_target(X, y1, y2 = NULL, cor_vars)

Arguments

X

A dataset containing y1, y2, and covariates. The row name is the name of x,y and covariate

y1

If cross lagged analysis is used between x and y, 'y1' is the name of x.

y2

y2 can be NULL. If cross lagged analysis is used between x and y, 'y2' is the name of y. 'y1' and 'y2' come from the same time point.

cor_vars

the name of covariate

Value

a list containing the covariate-adjusted value of y1 and y2 (If y2 is not NULL)

Examples

data(test_data1)
result <- adjust_target(X=test_data1,y1="ASI",y2=NULL,cor_vars=c("HDL_C","LDL_C"))

[Package crosslag version 0.1.0 Index]