lambda_diff: Calculate lambdas for two competing hypotheses

View source: R/helper.R

lambda_diffR Documentation

Calculate lambdas for two competing hypotheses

Description

If you want to test two competing hypotheses, you can use this helper function to create the correct difference lambdas. There is no magic here. The two contrasts are z-standardized first and then subtracted (lambda_preferred - lambda_competing). You can use the new difference lambdas as the input for calc_contrast.

Usage

lambda_diff(lambda_preferred, lambda_competing, labels = NULL)

Arguments

lambda_preferred

Lambdas of the preferred hypothesis. Has to be a named vector with the names corresponding with the groups in the analyzed data set. Alternatively, use the parameter labels.

lambda_competing

Lambdas of the competing hypothesis. Has to be a named vector with the names corresponding with the groups in the analyzed data set. Alternatively, use the parameter labels.

labels

If you provide lambdas without names, you can set the group labels for both contrasts here.

Value

Lambdas for difference between lambda_preferred and lambda_competing

Examples

lambda <- lambda_diff(c("A" = 1, "B" = 2, "C" = 3),
                      c("A" = 1, "B" = 2, "C" = 6))
lambda
# same result
lambda2 <- lambda_diff(c(1, 2, 3), c(1, 2, 6),
                       labels = c("A", "B", "C"))
lambda2

cofad documentation built on Sept. 11, 2024, 6:34 p.m.