View source: R/Cor2DataFrame.R
| Cor2DataFrame | R Documentation |
Variable and appended moderator column names must not contain periods; rename them consistently, e.g., x.1 to x_1, and check for duplicates. Multi-column moderator names generated with periods are converted to underscores; collisions are rejected. Study names may contain periods. Generated pair labels that would collide are made unique with a _dup suffix; existing objects with ambiguous duplicate labels must be regenerated.
It converts the correlation or covariance matrices into a dataframe of
correlations or covariances with their asymptotic sampling covariance
matrices. It uses the asyCov at the backend.
Cor2DataFrame(
x,
n,
v.na.replace = TRUE,
cor.analysis = TRUE,
acov = c("weighted", "individual", "unweighted"),
Means,
row.names.unique = FALSE,
append.vars = TRUE,
asyCovOld = FALSE,
...
)
x |
A list of data with correlation/covariance matrix in |
n |
If |
v.na.replace |
Logical. For weighted or unweighted average sampling covariance matrices, replace missing covariance entries by their available weighted or unweighted mean before calculating sampling covariances. An entry missing from every study cannot be replaced and raises an error. |
cor.analysis |
Logical. The output is either a correlation or covariance matrix. |
acov |
If it is |
Means |
An optional matrix of means. The number of rows must be the
same as the length of |
row.names.unique |
Logical. If it is |
append.vars |
Whether to append the additional variables to the output dataframe. |
asyCovOld |
Whether to use the legacy Hessian-based method. It requires complete covariances among retained variables in its working matrix. |
... |
Further arguments to be passed to
|
A list of components: (1) a data frame of correlations or covariances with their sampling covariance matrices; (2) a vector of sample sizes; (3) labels of the correlations; and (4) labels of their sampling covariance matrices.
Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>
asyCov, osmasem,
create.vechsR, create.Tau2,
create.V
## Provide a list of correlation matrices and a vector of sample sizes as the inputs
my.df1 <- Cor2DataFrame(Nohe15A1$data, Nohe15A1$n)
## Add Lag time as a variable
my.df1$data <- data.frame(my.df1$data, Lag=Nohe15A1$Lag, check.names=FALSE)
## Data
my.df1$data
## Sample sizes
my.df1$n
## ylabels
my.df1$ylabels
## vlabels
my.df1$vlabels
#### Simplified version to do it
my.df2 <- Cor2DataFrame(Nohe15A1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.