Last chance! 50% off unlimited learning
Sale ends in
Estimate the correlation between two variables
correlation_kim(
x = NULL,
y = NULL,
data = NULL,
x_var_name = NULL,
y_var_name = NULL,
ci_range = 0.95,
round_r = 2,
round_p = 3,
output_type = "summary"
)
a numeric vector of data values
a numeric vector of data values
(optional) a data object (a data frame or a data.table)
(optional) name of the first variable (if using a data set as an input)
(optional) name of the second variable (if using a data set as an input)
range of the confidence interval for the correlation
coefficient. If ci_range = FALSE
, no confidence interval
will be estimated. By default, ci_range = 0.95
.
number of decimal places to which to round correlation coefficients (default = 2)
number of decimal places to which to round p-values (default = 3)
type of the output. If output_type = "dt"
,
the function's output will be a data.table with the results from the
correlation analysis. If output_type = "summary"
, the function's
output will be a statement (a string) summarizing the results from
the correlation analysis. By default, output_type = "summary"
if (FALSE) {
correlation_kim(x = 1:4, y = c(1, 3, 2, 4))
correlation_kim(x = 1:4, y = c(1, 3, 2, 4), ci_range = FALSE)
# output as a data table
correlation_kim(x = 1:4, y = c(1, 3, 2, 4), output_type = "dt")
}
Run the code above in your browser using DataLab