indivClo: Estimates either an uncoupled or coupled oscillator model for...

Description Usage Arguments Value Examples

View source: R/clo.R

Description

Both models predict the second derivatives of the observed state variables (with linear trends removed). For the uncoupled oscillator, the predictors are each person's own observed state variables (again with linear trends removed), as well as each person's own first derivatives of the observed state variables (again with linear trends removed. For the coupled oscillator, the predictors are each person's own and partner's observed state variables (again with linear trends removed), as well as each person's own and partner's first derivatives of the observed state variables (again with linear trends removed).

Usage

1
indivClo(derivData, whichModel)

Arguments

derivData

A dataframe that was produced with the "estDerivs" function.

whichModel

Whether the model to be estimated is the "uncoupled" or "coupled" oscillator.

Value

The function returns a list including: 1) the adjusted R^2 for the model for each dyad (called "R2"), and 2) the parameter estimates for the model for each dyad (called "params", for use in either predicting, or being predicted by, the system variable).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data <- rties_ExampleDataShort
newData <- dataPrep(basedata=data, dyadId="couple", personId="person", 
obs_name="dial", dist_name="female", time_name="time")
taus <-c(2,3)
embeds <- c(3,4)
delta <- 1
derivs <- estDerivs(prepData=newData, taus=taus, embeds=embeds, delta=delta, idConvention=500)
clo <- indivClo(derivData=derivs$data, whichModel="coupled")
summary(clo$R2)
head(clo$params)

rties documentation built on July 2, 2020, 4:11 a.m.