taba.partial: Robust Partial and Semipartial Correlation

Description Usage Arguments Details Value References See Also Examples

View source: R/TabaPartial.R

Description

Calculates a partial or semipartial correlation using one of the specified robust methods Taba linear or Taba rank correlation.

Usage

1
2
3
taba.partial(x, y, ..., regress, method = c("taba", "tabarank", "tabwil", "tabwilrank"),
             alternative = c("less", "greater", "two.sided"),
             semi = c("none", "x", "y"), omega)

Arguments

x

A numeric vector of length greater than 2 must be same length as y and covariates listed in ...

y

A numeric vector of length greater than 2 must be same length as x and covariates listed in ...

...

Numeric vectors used as covariates of length equal to x and y

regress

A string variable "linear" for linear regression, "logistic" for binary logistic regression, and "poisson" for Poisson regression

method

A character string of "taba", "tabarank", "tabwil", or "tabwilrank" determining if one wants to calculate Taba linear, Taba rank (monotonic), TabWil, or TabWil rank correlation, respectively. If no method is specified, the function will output Taba Linear correlation.

alternative

Character string specifying the alternative hypothesis must be one of "less" for negative association, "greater" for positive association, or "two.sided" for difference in association. If the alternative is not specified, the function will default to a two sided test.

semi

A character string specifying which variable (x or y) should be adjusted.

omega

Numeric allowing the user to alter the tuning constant. If one is not specified, the function will default to 0.45 for Taba and Taba rank, and 0.1 for TabWil and TabWil rank. Range is between 0 and 1.

Details

This function calculates the partial or semipartial association of two numeric vectors, or columns of a matrix or data frame composed of more than two numeric elements, adjusting for covariates of length equal to x and y. Covariates are combined colomn-wise and can be numeric vectors, matricies, or data frames with numeric cells. Each column in the matrix or data frame will be treated as a different covariate, and must have different names from x and y. Missing values in x, y, or any of the covariates are deleted row-wise. The default for this function is a two sided test using Taba linear partial correlation, with the tuning constant omega equal to 0.45 for Taba and Taba rank, and 0.1 for TabWil and TabWil rank. Range is between 0 and 1. The variable you are not controlling must be continuous when using semipartial correlation.

Value

This function returns the robust association between two numeric vectors, adjusting for specified covariates. In addition, this function can provide the semipartial correlation, if specified.

References

Tabatabai, M., Bailey, S., Bursac, Z. et al. An introduction to new robust linear and monotonic correlation coefficients. BMC Bioinformatics 22, 170 (2021). https://doi.org/10.1186/s12859-021-04098-4

doi: 10.1186/s12859-021-04098-4

See Also

taba for calculating Taba linear or Taba rank (monotonic) correlations
taba.test for testing Taba linear or Taba rank (monotonic) correlations
taba.gpartial for generalized partial correlations
taba.matrix for calculating correlation, p-value, and distance matricies

Examples

1
2
3
4
5
6
7
x = rnorm(100)
y = rnorm(100)
z1 = rnorm(100)
z2 = rnorm(100)
z3 = rnorm(100)
taba.partial(x, y, z1, z2, z3, method = "tabwilrank")
taba.partial(x, y, z2, alternative = "less", semi = "x")

Example output

$correlation
[1] -0.08511758

$t.statistic
[1] -0.8326453

$p.value
[1] 0.4071332

$correlation
[1] -0.1757036

$t.statistic
[1] -1.757826

$p.value
[1] 0.9590341

Taba documentation built on April 1, 2021, 1:06 a.m.

Related to taba.partial in Taba...