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



Developmental Psychopathology Lab