clpm_gam_c: Title Nonlinear Cross Lag Analysis

View source: R/clpm_gam_c.R

clpm_gam_cR Documentation

Title Nonlinear Cross Lag Analysis

Description

Title Nonlinear Cross Lag Analysis

Usage

clpm_gam_c(xname, yname, data.x1, data.y1, data.xt, data.yt)

Arguments

xname

If nonlinear cross lagged analysis is used between x and y, 'xname' is the name of x

yname

If nonlinear cross lagged analysis is used between x and y, 'yname' is the name of y

data.x1

A numeric variable.

data.y1

A numeric variable. 'data.x1' and 'data.y1' comes from the first time point

data.xt

A numeric variable.

data.yt

A numeric variable. 'data.xt' and 'data.yt' comes from the another time point

Value

A list containing two elements

clpm_gam_result

a dataframe containing the result of nonlinear cross lag analysis

clpm_gam_plot

a list of plot generated by 'ggplot' and 'ggarrange', you can use 'ggarrange(clpm_gam_plot[[2]])' to plot it

Examples

data(test_data1)
data(test_data2)
result <- clpm_gam_c(xname="ASI",yname = "PWRI",
                     data.x1 = test_data1$ASI,data.y1 = test_data1$PWRI,
                     data.xt = test_data2$ASI,data.yt = test_data2$PWRI)

crosslag documentation built on May 29, 2024, 7:25 a.m.