Description Usage Arguments Details Value Examples
View source: R/facets_semi_partial_r_table.R
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.
1 | facets_semi_partial_r_table(dv, facets, factors, data, return_pvalue = FALSE)
|
dv |
character string of the criterion variable name in |
facets |
character vector of the facet variable names in |
factors |
character string of the factor variable names in |
data |
data.frame |
return_pvalue |
logical indicating whether to return p-values associated with each correlation |
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.
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.
r_zero_order
: zero order corelation
sr_focal_factor
: semi-partial correlation controlling only for focal factor
sr_all_factors
: semi-partial correlation controlling for all factors
sr_other_facets
: semi-partial correlation controlling for all other facets
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, "*", ""))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.