Learn R Programming

statpsych (version 1.7.0)

slope.contrast: Contrast coefficients for the slope of a quantitative factor

Description

Computes the contrast coefficients that are needed to estimate the slope of a line in a one-factor design with a quantitative factor.

Usage

slope.contrast(x)

Value

Returns the vector of contrast coefficients

Arguments

x

vector of numeric factor levels

Examples

Run this code
x <- c(25, 50, 75, 100)
slope.contrast(x)

# Should return:
#      Coefficient
# [1,]      -0.012
# [2,]      -0.004
# [3,]       0.004
# [4,]       0.012
 

Run the code above in your browser using DataLab