of 22 /22
Restructuring Dyadic Data David A. Kenny January 9, 2015

Restructuring Dyadic Data David A. Kenny January 9, 2015

Embed Size (px)

Text of Restructuring Dyadic Data David A. Kenny January 9, 2015

  • Slide 1

Restructuring Dyadic Data David A. Kenny January 9, 2015 Slide 2 Background Dyadic Data Structures Individual One record for each person Own persons variables Dyad One record for the dyad Both persons variables Pairwise One record for each person Both persons variables View: http://davidakenny.net/webinars/Dyad/General/DDS/DDS.html 2 Slide 3 The Problem You have one data structure and you want to convert to another. individual to dyad individual to pairwise dyad to pairwise Other conversions are trivial and can be accomplished either by deleting cases or renaming variables. 3 Slide 4 Dyad ID For restructuring individual data, a unique identification number for each pair of persons is needed. For longitudinal standard design, the DyadID is for each time point for each dyad. 4 Slide 5 Usual Strategies to Restructure Restructuring by entering the data the right way. Cut and paste Computer programs Built in routines to restructure SPSS: davidakenny.net/webinars/powerpoints/Dyad/General/Restructuring.pdf davidakenny.net/webinars/powerpoints/Dyad/General/Restructuring.pdf 5 Slide 6 New Strategies to Restructure R programs Individual to pairwise Individual to dyad Dyad to pairwise Apps Individual to pairwise Individual to dyad Dyad to pairwise SPSS macro (no longer maintained) Individual to pairwise Individual to dyad 6 Slide 7 R Restructuring Programs Written in R Co-written with Thomas Ledermann of Utah State University Information available at http://davidakenny.net/doc/RDDD.pdf http://davidakenny.net/doc/RDDD.pdf 7 Slide 8 Details Installing R davidakenny.net/doc/InstallR.pdf Three programs ItoP.R: Individual to pairwise davidakenny.net/kkc/c1/ItoP.R ItoD.R: Individual to dyad http://davidakenny.net/kkc/c1/ItoD.R DtoP.R: Dyad to pairwise davidakenny.net/kkc/c1/DtoP.R 8 Slide 9 General R Program RDDD Description: davidakenny.net/doc/RDDD.pdf Program: davidakenny.net/progs/RDDD.R 9 Slide 10 Slide 11 Descriptive Information for Dyad Dataset The dataset c:/ai.sav has been transformed from an individual to a dyad dataset called c:/dyad.csv. The distinguishing variable is Gender, and it has two levels, Wives (-1) and Husbands (1). There are 148 dyads and 296 individuals, 148 Wives and 148 Husbands. There are no missing data on any of the variables in the dataset. There are 7 variables, 1 between-dyad variable, 1 within-dyad variable, and 5 mixed variables. The one between-dyad variable is Years Married, and the one within-dyads variable is Gender. The within-dyads variable, Gender, is a dichotomy and could be used as a distinguishing variable. The descriptive statistics for the variables as individuals are contained in Table 1 and the descriptive and inferential statistics as dyads are contained in Table 2. Slide 12 Table 1: Descriptive Statistics for Individuals (All Variables) Variable Mean sd Minimum Maximum Intra. r Years Married -0.000 7.707 -11.214 15.036 1.000 Gender 0.000 1.002 -1.000 1.000 -1.000 Self Positivity 4.186 0.412 2.600 5.000 0.087 Other Positivity 4.264 0.498 2.600 5.000 0.235 Satisfaction 3.605 0.496 1.167 4.000 0.618 Tension 2.431 0.687 1.000 4.000 0.319 Similar Hobbies 0.078 0.646 -1.000 1.000 0.281 Slide 13 Table 2: Inferential and Descriptive Statistics for Dyads (Mixed Variables) Mean sd Variable Wives Husbands p Wives Husbands p r p Self Positivity 4.291 4.082