Skip to contents

This function calculates the contrast coefficients used to test for a linear relationship across treatment levels.

Usage

getLineContrast(Data, Treatment)

Arguments

Data

A data frame containing the treatment variable

Treatment

The name of the treatment variable in the data frame

Value

A numeric vector of contrast coefficients for linear trend testing

Examples

test_data <- data.frame(Dose = factor(c(0, 1, 2, 3, 0, 1, 2, 3)))
getLineContrast(test_data, "Dose")
#> [1] -3 -1  1  3