clpm_gamm4_r {crosslag}R Documentation

Title Cross-lag analysis based on generalized additive mixture models: autoregression

Description

Title Cross-lag analysis based on generalized additive mixture models: autoregression

Usage

clpm_gamm4_r(xname, yname, data.x1, data.y1, data.xt, data.yt, z)

Arguments

xname

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

yname

If 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 'data.x1', 'data.y1','data.xt' and 'data.yt' can be the data processed by the function 'adjust_target()'

z

In the generalized additive mixture model, a random intercept is specified and the random effects are grouped by z. 'z' and 'data.x1', 'data.y1','data.xt','data.yt' are all numeric variables that should ideally correspond to each other.

Value

A dataframe containing the result of autoregression based on generalized additive mixture model:'Xt~X1' 'Yt~Y1'.

Examples

data(test_data1)
data(test_data2)
result <- clpm_gamm4_r("ASI","PWRI",test_data1$ASI,test_data1$PWRI,
                     data.xt = test_data2$ASI,data.yt = test_data2$PWRI,z=test_data1$time)

[Package crosslag version 0.1.0 Index]