Repeated Summary Correlations
Source:vignettes/RepeatedSummaryCorrelations.Rmd
RepeatedSummaryCorrelations.Rmd
This page analyzes a set of correlations among variables using summary statistics input.
Preliminary Tasks
Data Entry
This code inputs the variable summaries and creates a summary table.
Outcome1 <- c(N = 10, M = 8.000, SD = 1.414)
Outcome2 <- c(N = 10, M = 11.000, SD = 2.211)
Outcome3 <- c(N = 10, M = 12.000, SD = 2.449)
RepeatedMoments <- construct(Outcome1, Outcome2, Outcome3, class = "wsm")
This code creates a correlation matrix.
Summary Statistics
This code confirms the descriptive statistics from the summary tables.
(RepeatedMoments) |> describeMoments()
Summary Statistics for the Data
N M SD
Outcome1 10.000 8.000 1.414
Outcome2 10.000 11.000 2.211
Outcome3 10.000 12.000 2.449
(RepeatedCorrs) |> describeCorrelations()
Correlations for the Data
Outcome1 Outcome2 Outcome3
Outcome1 1.000 0.533 0.385
Outcome2 0.533 1.000 0.574
Outcome3 0.385 0.574 1.000
Analyses of a Correlation
This section produces analyses of a single correlation.
Scatterlot and Confidence Ellipse
This code provides a confidence ellipse for the bivariate relationship. Because there is no raw data, no data points are visible and the code defaults instead to an ellipse.
(RepeatedMoments) |> focus(Outcome1, Outcome2) |> plotScatter(RepeatedCorrs)
The ellipse can be altered for different confidence levels.
(RepeatedMoments) |> focus(Outcome1, Outcome2) |> plotScatter(RepeatedCorrs, conf.level = .99)
Confidence Interval
This code will provide the confidence interval for the correlation.
(RepeatedMoments) |> focus(Outcome1, Outcome2) |> estimateCorrelations(RepeatedCorrs)
Confidence Intervals for the Correlations
R SE LL UL
Outcome1 & Outcome2 0.533 0.378 -0.145 0.870
This code will produce a graph of the confidence interval for the correlation.
(RepeatedMoments) |> focus(Outcome1, Outcome2) |> plotCorrelations(RepeatedCorrs)
The code defaults to 95% confidence intervals. This can be changed if desired.
(RepeatedMoments) |> focus(Outcome1, Outcome2) |> estimateCorrelations(RepeatedCorrs, conf.level = .99)
Confidence Intervals for the Correlations
R SE LL UL
Outcome1 & Outcome2 0.533 0.378 -0.362 0.917
Of course, it is possible to change from the default confidence level in the graph. It is also possible to add a comparison value and a region of practical equivalence.
(RepeatedMoments) |> focus(Outcome1, Outcome2) |> plotCorrelations(RepeatedCorrs, conf.level = .99, line = 0, rope = c(-.2, .2))
Significance Test
This code will produce a table of NHST for the correlation (against a value of zero).
(RepeatedMoments) |> focus(Outcome1, Outcome2) |> testCorrelations(RepeatedCorrs)
Hypothesis Tests for the Correlations
R SE df t p
Outcome1 & Outcome2 0.533 0.299 8.000 1.782 0.113
Analyses of Several Correlations
This section analyzes the correlations among multiple variables.
Confidence Intervals
This code will provide the confidence intervals for the correlations.
(RepeatedMoments) |> estimateCorrelations(RepeatedCorrs)
Confidence Intervals for the Correlations
R SE LL UL
Outcome1 & Outcome2 0.533 0.378 -0.145 0.870
Outcome1 & Outcome3 0.385 0.378 -0.323 0.817
Outcome2 & Outcome3 0.574 0.378 -0.087 0.884
This code will produce a graph of the confidence intervals for the correlations.
(RepeatedMoments) |> plotCorrelations(RepeatedCorrs)
The code defaults to 95% confidence intervals. This can be changed if desired.
(RepeatedMoments) |> estimateCorrelations(RepeatedCorrs, conf.level = .99)
Confidence Intervals for the Correlations
R SE LL UL
Outcome1 & Outcome2 0.533 0.378 -0.362 0.917
Outcome1 & Outcome3 0.385 0.378 -0.514 0.881
Outcome2 & Outcome3 0.574 0.378 -0.310 0.926
Of course, it is possible to change from the default confidence level in the graph. It is also possible to add a comparison value and a region of practical equivalence.
(RepeatedMoments) |> plotCorrelations(RepeatedCorrs, conf.level = .99, line = 0, rope = c(-.2, .2))
Significance Tests
This code will produce a table of NHST for the correlations (against a value of zero).
(RepeatedMoments) |> testCorrelations(RepeatedCorrs)
Hypothesis Tests for the Correlations
R SE df t p
Outcome1 & Outcome2 0.533 0.299 8.000 1.782 0.113
Outcome1 & Outcome3 0.385 0.326 8.000 1.180 0.272
Outcome2 & Outcome3 0.574 0.290 8.000 1.983 0.083