darma.Rd
Computes bivariate association measures between a response and predictor variables, producing a summary looking like a regression analysis.
darma(y, x, weights = NULL, target = 1,
na.rm.cat = FALSE, na.value.cat = "NAs", na.rm.cont = FALSE,
correlation = "kendall",
nperm = NULL, distrib = "asympt", dec = c(1,3,3))
the response variable
the predictor variables
numeric vector of weights. If NULL (default), uniform weights (i.e. all equal to 1) are used.
rank or name of the category of interest when y is categorical
logical, indicating whether NA values in the categorical variables should be silently removed before the computation proceeds. If FALSE (default), an additional level is added to the categorical variables (see na.value.cat argument).
character. Name of the level for NA category. Default is "NAs". Only used if na.rm.cat = FALSE.
logical, indicating whether NA values in the continuous variables should be silently removed before the computation proceeds. Default is FALSE.
character. The type of measure of correlation measure to use between two continuous variables : "pearson", "spearman" or "kendall" (default).
numeric. Number of permutations for the permutation test of independence. If NULL (default), no permutation test is performed.
the null distribution of permutation test of independence can be approximated by its asymptotic distribution ("asympt"
, default) or via Monte Carlo resampling ("approx"
).
vector of 3 integers for number of decimals. The first value if for percents or medians, the second for association measures, the third for permutation p-values. Default is c(1,3,3).
The function computes association measures (phi, correlation coefficient, Kendall's correlation) between the variable of interest and the other variables. It can also compute the p-values permutation tests.
A data frame
data(iris)
iris2 = iris
iris2$Species = factor(iris$Species == "versicolor")
darma(iris2$Species, iris2[,1:4], target=2, nperm=100)
#> variable category percent association perm.pvalue
#> 1 Sepal.Length NA 0.079 0.475
#> 2 Sepal.Width NA -0.468 0.000
#> 3 Petal.Length NA 0.202 0.000
#> 4 Petal.Width NA 0.118 0.230