actorPartnerDataCross {rties} | R Documentation |
Takes individual cross-sectional data from dyads and turns it into actor-partner format.
Description
Need to use a person ID that has first person in dyad numbered 1-n and second person in dyad = ID + some number larger than the number of dyads. Need dyad ID numbered same as for person ID for the first person in the dyad. Both members in each dyad need to have the same number of rows (rows of missing data are ok)
Usage
actorPartnerDataCross(basedata, dyadId, personId)
Arguments
basedata |
A dataframe with cross-sectional dyadic data. |
dyadId |
The name of variable indicating dyad ID. |
personId |
The name of the variable indicating peron ID. |
Value
A dataframe in actor-partner format.
Examples
data <- rties_ExampleDataShort
newData1 <- data[data$time==1, ] # make a cross-sectional dataframe
newData2 <- actorPartnerDataCross(basedata=newData1, dyadId="couple", personId="couple")
head(newData2)
[Package rties version 5.0.0 Index]