Skip to contents

This function calculates the polychoric correlations between pairs of variables in a given data frame. It returns a data frame with the row and column names of the variables, the polychoric correlation coefficient, and its standard error.

Usage

polycorr(data, varlist)

Arguments

data

data frame with "markname" and study names as column names.

varlist

character vector of study names to include in the meta-analysis.

Value

data frame with polychoric correlation coefficients and standard errors

See also

polychor

Author

Woo Jung

Examples

  data(snp_example)
  head(snp_example)
#>         markname    trt1   trt2   trt3
#> 1 c01b000015585s 0.35580 0.7356 0.6920
#> 2 c01b000015644s 0.58850 0.4539 0.7164
#> 3 c01b000015647s 0.18840 0.3029 0.2111
#> 4 c01b000015717s 0.99820 0.2474 0.2029
#> 5 c01b000015721s 0.74750 0.2206 0.1954
#> 6 c01b000016805s 0.08051 0.1532 0.7910
  varlist <- c("trt1","trt2","trt3")
  polycorr(snp_example, varlist)
#>    row  col      PLCORR E_PLCORR
#> 1 trt1 trt1  1.00000000        0
#> 2 trt1 trt2 -0.09051849       NA
#> 3 trt1 trt3 -0.45007128       NA
#> 4 trt2 trt1 -0.09051553       NA
#> 5 trt2 trt2  1.00000000        0
#> 6 trt2 trt3  0.36202025       NA
#> 7 trt3 trt1 -0.44174623       NA
#> 8 trt3 trt2  0.36159934       NA
#> 9 trt3 trt3  1.00000000        0