Skip to contents

Dataframe used to compute cross-time correlations.

Usage

crossTimeCorrelationDF(id = "tcid", time = "age", variable, data)

Arguments

id

Name of variable indicating the participant ID.

time

Name of variable indicating the timepoint.

variable

Name of variable to estimate the cross-time correlation.

data

Dataframe.

Value

dataframe with three columns in the form of: ID, time1, time2

Details

Dataframe used to calculate the association of a variable across multiple time points. It is especially useful when there are three or more time points.

See also

Other correlations: addText(), cor.table(), crossTimeCorrelation(), partialcor.table(), vwReg()

Examples

# Prepare Data
df <- expand.grid(ID = 1:100, time = c(1, 2, 3))
df <- df[order(df$ID),]
row.names(df) <- NULL
df$score <- rnorm(nrow(df))

# Cross-Time Correlation
crossTimeCorrelationDF(id = "ID", time = "time", variable = "score", data = df)
#>      ID       time1       time2
#> 1     1 -1.07806726 -1.14356572
#> 2     1 -1.14356572 -0.52964368
#> 3     2 -0.68127316 -0.20244756
#> 4     2 -0.20244756  1.68449572
#> 5     3 -1.03377324 -0.15597667
#> 6     3 -0.15597667 -0.04640064
#> 7     4 -0.95362873  0.41626080
#> 8     4  0.41626080  0.11402961
#> 9     5  0.06391875 -0.91933224
#> 10    5 -0.91933224  0.90133529
#> 11    6 -0.79772830  0.66822120
#> 12    6  0.66822120  0.15521430
#> 13    7  0.12868809 -1.53306545
#> 14    7 -1.53306545  0.20236067
#> 15    8 -0.71753865  0.36169476
#> 16    8  0.36169476  1.39900429
#> 17    9  0.37269896 -1.56564429
#> 18    9 -1.56564429 -0.05169454
#> 19   10  0.51408210  0.54989952
#> 20   10  0.54989952  0.86781691
#> 21   11  0.68436008 -0.16267998
#> 22   11 -0.16267998 -1.78436472
#> 23   12 -1.03714557  0.83014772
#> 24   12  0.83014772  0.60734694
#> 25   13 -0.12218636  0.93312514
#> 26   13  0.93312514 -0.96127668
#> 27   14  0.25508171 -0.54540157
#> 28   14 -0.54540157  0.93036074
#> 29   15 -0.53765056 -0.45242607
#> 30   15 -0.45242607 -0.43929097
#> 31   16 -0.61622311  0.44163455
#> 32   16  0.44163455  0.48259745
#> 33   17  0.54214438 -2.29078465
#> 34   17 -2.29078465  0.31035185
#> 35   18  1.40407898  1.37711764
#> 36   18  1.37711764  1.06039565
#> 37   19  0.63217289  1.08492804
#> 38   19  1.08492804  1.35645944
#> 39   20  0.36242404  2.16934446
#> 40   20  2.16934446  0.13913051
#> 41   21  1.37632653 -0.49144999
#> 42   21 -0.49144999  1.53491576
#> 43   22 -0.41619872 -0.52054380
#> 44   22 -0.52054380  0.85058387
#> 45   23  0.33449657 -0.82935177
#> 46   23 -0.82935177 -0.21869594
#> 47   24 -1.54508372  0.23322978
#> 48   24  0.23322978  0.03106964
#> 49   25  0.35786565  1.60862422
#> 50   25  1.60862422  1.42985426
#> 51   26 -0.94833964  1.01570554
#> 52   26  1.01570554  0.03773461
#> 53   27 -1.74423940 -0.97007381
#> 54   27 -0.97007381 -0.22902736
#> 55   28 -0.97484568  2.69237242
#> 56   28  2.69237242  1.39239386
#> 57   29  1.36007615 -0.36541588
#> 58   29 -0.36541588 -0.86893720
#> 59   30 -0.50655673  1.21470730
#> 60   30  1.21470730  0.50695868
#> 61   31 -2.09497131  0.03407924
#> 62   31  0.03407924  0.85272870
#> 63   32  0.74322814  0.55715361
#> 64   32  0.55715361 -1.24858322
#> 65   33 -0.20787431  0.42396946
#> 66   33  0.42396946 -0.50669744
#> 67   34 -0.61152331  2.41165945
#> 68   34  2.41165945 -0.16495814
#> 69   35 -0.44040605  0.52197617
#> 70   35  0.52197617 -1.91832225
#> 71   36 -1.98264996  0.52120016
#> 72   36  0.52120016  0.77778320
#> 73   37 -0.81211887  0.91074832
#> 74   37  0.91074832  0.94875395
#> 75   38 -1.34804945  0.35417586
#> 76   38  0.35417586  0.53026393
#> 77   39 -0.31097493 -0.24415553
#> 78   39 -0.24415553 -0.29187819
#> 79   40 -1.12808616 -1.12288159
#> 80   40 -1.12288159  2.05393864
#> 81   41 -0.90951843  0.45837916
#> 82   41  0.45837916 -0.04661845
#> 83   42 -0.68095460 -1.48882940
#> 84   42 -1.48882940 -0.39251301
#> 85   43 -1.74968202 -0.03866763
#> 86   43 -0.03866763 -0.79715324
#> 87   44 -0.91592054  0.07326746
#> 88   44  0.07326746  1.23817132
#> 89   45  0.71837134  0.53946650
#> 90   45  0.53946650 -1.06123399
#> 91   46 -0.54073787 -0.71520471
#> 92   46 -0.71520471 -0.17892009
#> 93   47  0.16497028 -0.72740817
#> 94   47 -0.72740817 -0.53783713
#> 95   48 -0.59966490  1.18208775
#> 96   48  1.18208775  0.18921288
#> 97   49  0.24894911  1.04664341
#> 98   49  1.04664341 -1.28930094
#> 99   50  0.37511557 -0.55691839
#> 100  50 -0.55691839  0.30242663
#> 101  51  0.22226647 -0.96216696
#> 102  51 -0.96216696  0.05203237
#> 103  52  0.90004038 -0.39490088
#> 104  52 -0.39490088  0.95414600
#> 105  53 -0.58821435 -1.47658453
#> 106  53 -1.47658453 -1.37777577
#> 107  54 -1.34567231 -0.73663796
#> 108  54 -0.73663796 -0.47011150
#> 109  55  1.38060934  1.67501093
#> 110  55  1.67501093  1.17690663
#> 111  56 -0.14889834 -0.17782336
#> 112  56 -0.17782336  0.80312186
#> 113  57 -0.41579535  1.21248959
#> 114  57  1.21248959  1.24036003
#> 115  58  0.68567588 -0.02679868
#> 116  58 -0.02679868  0.30958051
#> 117  59  0.24986433 -1.35646087
#> 118  59 -1.35646087  0.59937977
#> 119  60  0.00864779  0.09071661
#> 120  60  0.09071661 -0.65705741
#> 121  61 -0.48178225  0.01775788
#> 122  61  0.01775788 -0.85953576
#> 123  62  1.35770498  1.21506118
#> 124  62  1.21506118  1.45391292
#> 125  63 -0.08591198 -0.61756875
#> 126  63 -0.61756875 -0.21826025
#> 127  64 -1.32600521 -2.36220890
#> 128  64 -2.36220890 -1.40996955
#> 129  65  0.25439714  0.29587030
#> 130  65  0.29587030  0.05678979
#> 131  66 -0.10265486  1.95192303
#> 132  66  1.95192303  0.87856596
#> 133  67 -1.30661693  0.09034427
#> 134  67  0.09034427  0.90235804
#> 135  68  0.54942132 -0.86983920
#> 136  68 -0.86983920 -0.03921465
#> 137  69 -0.51845168 -0.91184962
#> 138  69 -0.91184962  0.15031364
#> 139  70  0.44035545  1.31978206
#> 140  70  1.31978206  0.24656113
#> 141  71  0.94182660 -0.34215133
#> 142  71 -0.34215133 -0.27614681
#> 143  72  0.38365678  1.44691022
#> 144  72  1.44691022  1.73390029
#> 145  73  0.45642938  0.70750349
#> 146  73  0.70750349  2.06378922
#> 147  74  0.02391059  0.24594946
#> 148  74  0.24594946  0.27205914
#> 149  75 -0.99245858 -0.02757795
#> 150  75 -0.02757795  2.22284516
#> 151  76  0.15550390 -0.86911632
#> 152  76 -0.86911632 -1.17448945
#> 153  77 -1.75967731  0.05836159
#> 154  77  0.05836159  1.16451986
#> 155  78  0.33762789 -1.05451872
#> 156  78 -1.05451872  0.66076911
#> 157  79 -0.82340900  0.43703366
#> 158  79  0.43703366  0.37238811
#> 159  80 -1.64674913 -1.92355227
#> 160  80 -1.92355227  0.38083303
#> 161  81  1.37570535  0.82584873
#> 162  81  0.82584873 -0.41611500
#> 163  82  0.98214959  0.24218073
#> 164  82  0.24218073 -0.93792685
#> 165  83  1.50585850 -1.06585117
#> 166  83 -1.06585117  0.16227053
#> 167  84  0.26047039 -1.48820199
#> 168  84 -1.48820199  1.41518387
#> 169  85  0.56250751  0.64205574
#> 170  85  0.64205574 -0.89053264
#> 171  86 -0.11653752 -0.94197475
#> 172  86 -0.94197475  1.11582792
#> 173  87  0.47013513  0.86061271
#> 174  87  0.86061271 -0.07039665
#> 175  88 -0.61318021 -0.33671496
#> 176  88 -0.33671496 -0.21584018
#> 177  89  0.62113229 -1.28402652
#> 178  89 -1.28402652 -1.30009244
#> 179  90 -0.37676946  0.10374865
#> 180  90  0.10374865 -0.70356227
#> 181  91  1.49741394 -0.30282688
#> 182  91 -0.30282688 -1.37683133
#> 183  92  0.88317017  0.67142028
#> 184  92  0.67142028  1.23002238
#> 185  93  1.64546788 -0.18292604
#> 186  93 -0.18292604 -1.37925781
#> 187  94  1.25060060 -1.87623677
#> 188  94 -1.87623677 -0.36878757
#> 189  95 -2.12929731  0.33764603
#> 190  95  0.33764603 -1.57457485
#> 191  96 -0.19631941  0.91506011
#> 192  96  0.91506011  1.07863654
#> 193  97  1.45280285 -1.65328109
#> 194  97 -1.65328109 -2.76186752
#> 195  98  0.26436916  1.02457159
#> 196  98  1.02457159 -0.65918555
#> 197  99 -0.38630438 -0.24249895
#> 198  99 -0.24249895  0.22059324
#> 199 100 -1.48109003  0.72469120
#> 200 100  0.72469120 -2.37751470



Developmental Psychopathology Lab