Learn R Programming

psychmeta (version 2.3.4)

control_intercor: Control function to curate intercorrelations to be used in automatic compositing routine

Description

Control function to curate intercorrelations to be used in automatic compositing routine

Usage

control_intercor(rxyi = NULL, n = NULL, sample_id = NULL,
  construct_x = NULL, construct_y = NULL, construct_names = NULL,
  facet_x = NULL, facet_y = NULL, intercor_vec = NULL,
  intercor_scalar = 0.5, dx = NULL, dy = NULL, p = 0.5,
  partial_intercor = FALSE, data = NULL, ...)

Arguments

rxyi

Vector or column name of observed correlations.

n

Vector or column name of sample sizes.

sample_id

Vector of identification labels for samples/studies in the meta-analysis.

construct_x, construct_y

Vector of construct names for constructs designated as "X" or "Y".

construct_names

Vector of all construct names to be included in the meta-analysis.

facet_x, facet_y

Vector of facet names for constructs designated as "X" or "Y".

intercor_vec

Named vector of pre-specified intercorrelations among measures of constructs in the meta-analysis.

intercor_scalar

Generic scalar intercorrelation that can stand in for unobserved or unspecified values.

dx, dy

d values corresponding to construct_x and construct_y. These values only need to be supplied for cases in which rxyi represents a correlation between two measures of the same construct.

p

Scalar or vector containing the proportions of group membership corresponding to the d values.

partial_intercor

For meta-analyses of d values only: Logical scalar, vector, or column corresponding to values in rxyi that determines whether the correlations are to be treated as within-group correlations (i.e., partial correlation controlling for group membership; TRUE) or not (FALSE; default). Note that this only converts correlation values from the rxyi argument - any values provided in the intercor_vec or intercor_scalar arguments must be total correlations or converted to total correlations using the mix_r_2group() function prior to running control_intercor.

data

Data frame containing columns whose names may be provided as arguments to vector arguments.

...

Further arguments to be passed to functions called within the meta-analysis.

Value

A vector of intercorrelations

Examples

Run this code
# NOT RUN {
## Create a dataset in which constructs correlate with themselves
rxyi <- seq(.1, .5, length.out = 27)
construct_x <- rep(rep(c("X", "Y", "Z"), 3), 3)
construct_y <- c(rep("X", 9), rep("Y", 9), rep("Z", 9))
dat <- data.frame(rxyi = rxyi, 
                  construct_x = construct_x, 
                  construct_y = construct_y, 
                  stringsAsFactors = FALSE)
dat <- rbind(cbind(sample_id = "Sample 1", dat), 
             cbind(sample_id = "Sample 2", dat), 
             cbind(sample_id = "Sample 3", dat))

## Identify some constructs for which intercorrelations are not 
## represented in the data object:
construct_names = c("U", "V", "W")

## Specify some externally determined intercorrelations among measures:
intercor_vec <- c(W = .4, X = .1)

## Specify a generic scalar intercorrelation that can stand in for missing values:
intercor_scalar <- .5

control_intercor(rxyi = rxyi, sample_id = sample_id, 
                 construct_x = construct_x, construct_y = construct_y, 
                 construct_names = construct_names, 
                 intercor_vec = intercor_vec, intercor_scalar = intercor_scalar, data = dat)
# }

Run the code above in your browser using DataLab