facets_semi_partial_r_table: Semi-partial correlations between facets and criterion

Description Usage Arguments Details Value Examples

View source: R/facets_semi_partial_r_table.R

Description

Produce a data.frame of correlations between facets and criterion. Rows represent each facet and the four columns represent the zero-order correlation between facet and criterion followed by various semi-partial correlations where the facet is adjusted controlling for the focal factor, all factors, and all other facets respectively as described under the "Value" section.

Usage

1
facets_semi_partial_r_table(dv, facets, factors, data, return_pvalue = FALSE)

Arguments

dv

character string of the criterion variable name in data

facets

character vector of the facet variable names in data

factors

character string of the factor variable names in data. This string should be the same length as the facets list. Thus, factor names should repeat and correspond to the factor for the facet in the corresponding position in facets.

data

data.frame

return_pvalue

logical indicating whether to return p-values associated with each correlation

Details

The table is useful for examining the degree to which facets provide a unique contribution to predicting a criterion. In particular, facets controlling for factors is particularly relevant to discussion regarding the incrmental value of facets.

Value

By default a data frame of correlations is return. If return_pvalue is true then a list of two data frames is returned one with the correlations and the other with the pvalues.

  1. r_zero_order: zero order corelation

  2. sr_focal_factor: semi-partial correlation controlling only for focal factor

  3. sr_all_factors: semi-partial correlation controlling for all factors

  4. sr_other_facets: semi-partial correlation controlling for all other facets

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Load data and meta data:
data(facets_data); data(facets_meta)

## Here we see how the facets and factors should be organised:
cbind(facets=facets_meta$ipip_facets,
       factors=rep(facets_meta$ipip_factors, each=6))

facets_semi_partial_r_table('swl',
    facets_meta$ipip_facets,
    rep(facets_meta$ipip_factors, each=6),
    facets_data)

## Return p-values
x <- facets_semi_partial_r_table('swl',
                                 facets_meta$ipip_facets,
                                rep(facets_meta$ipip_factors, each=6),
                               facets_data, return_pvalue=TRUE)

alpha <- .001
cbind(x$p[,1:2], ifelse(x$p[,3:6]<alpha, "*", ""))

jeromyanglim/personalityfacets documentation built on Dec. 23, 2019, 7:31 p.m.