rMatrix provides a correlation matrix with confidence intervals and a p-value adjusted for multiple testing.
rMatrix(
dat,
x,
y = NULL,
conf.level = 0.95,
correction = "fdr",
digits = 2,
pValueDigits = 3,
colspace = 2,
rowspace = 0,
colNames = "numbers"
)
# S3 method for rMatrix
print(
x,
digits = x$digits,
pValueDigits = x$pValueDigits,
colNames = x$colNames,
...
)
A dataframe containing the relevant variables.
Vector of 1+ variable names.
Vector of 1+ variable names; if this is left empty, a symmetric matrix is created; if this is filled, the matrix will have the x variables defining the rows and the y variables defining the columns.
The confidence of the confidence intervals.
Correction for multiple testing: an element out of the vector c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none"). NOTE: the p-values are corrected for multiple testing; The confidence intervals are not (yet :-)).
With what precision do you want the results to print.
Determines the number of digits to use when displaying p values. P-values that are too small will be shown as p<.001 or p<.00001 etc.
Number of spaces between columns
Number of rows between table rows (note: one table row is 2 rows).
colNames can be "numbers" or "names". "Names" cause variables names to be printed in the heading; "numbers" causes the rows to become numbered and the numbers to be printed in the heading.
Additional arguments are ignored.
An rMatrix
object that when printed shows the correlation matrix
An object with the input and several output variables. Most notably a number of matrices:
Pearson r values.
Degrees of freedom.
Lower bound of Pearson r confidence interval.
Upper bound of Pearson r confidence interval.
Original p-values.
p-values adjusted for multiple testing.
rMatrix provides a symmetric or asymmetric matrix of correlations, their confidence intervals, and p-values. The p-values can be corrected for multiple testing.
rMatrix(mtcars, x=c('disp', 'hp', 'drat'))
#> 1 2 3
#> 1 disp
#>
#> 2 hp [.61; .89]
#> r=.79, p<.001
#> 3 drat [-.85; -.48] [-.69; -.12]
#> r=-.71, p<.001 r=-.45, p=.01
#> <table class="table" style="margin-left: auto; margin-right: auto;">
#> <thead>
#> <tr>
#> <th style="text-align:left;"> </th>
#> <th style="text-align:left;"> disp </th>
#> <th style="text-align:left;"> hp </th>
#> <th style="text-align:left;"> drat </th>
#> </tr>
#> </thead>
#> <tbody>
#> <tr>
#> <td style="text-align:left;"> disp </td>
#> <td style="text-align:left;"> </td>
#> <td style="text-align:left;"> </td>
#> <td style="text-align:left;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;"> hp </td>
#> <td style="text-align:left;"> r = [.61; .89]<br>r(30) = .79, p < .001 </td>
#> <td style="text-align:left;"> </td>
#> <td style="text-align:left;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;"> drat </td>
#> <td style="text-align:left;"> r = [-.85; -.48]<br>r(30) = -.71, p < .001 </td>
#> <td style="text-align:left;"> r = [-.69; -.12]<br>r(30) = -.45, p = .01 </td>
#> <td style="text-align:left;"> </td>
#> </tr>
#> </tbody>
#> </table>