test.contrast: Test a contrast

View source: R/testContrast.R

test.contrastR Documentation

Test a contrast

Description

This function can test a contrast based on parameter estimates beta, a variance covariance matrix vcov, a number of degrees of freedom df, a residual error term sigma and a contrast matrix L.

Usage

test.contrast(beta, vcov, df, sigma, L, lfc = 0)

Arguments

beta

A matrix with a single column containing parameter estimates.

vcov

A matrix of the estimated covariances between the parameter estimates.

df

A vector of numeric values indicating the degrees of freedom corresponding to each contrast or a single numeric value if the degrees of freedom for each contrast are equal.

sigma

A numeric value indicating a residual standard deviation.

L

A contrast matrix with the parameter levels as rows and a column for each contrast.

lfc

The minimum log2-fold-change that is considered scientifically meaningful. Defaults to 0.

Value

A matrix with a row for each contrast in L and with four columns: (1) estimate, containing the size estimates of the contrasts; (2) se, containing the estimated standard error on the contrast; (3) Tval, containing the T-value corresponding to the contrast; (4) pval, containing the p-value corresponding to the contrast.

References

David Ruppert, M.P. Want and R.J. Carroll. Semiparametric Regression. Cambridge University Press, 2003.

Examples

#Load the protLM object protmodel:
protmodel <- data(modelRR, package="MSqRob")
betaVcovDfList <- getbetaVcovDfList(protmodel)
contrasts <- test.contrast(betaVcovDfList)
contrasts

statOmics/MSqRob documentation built on Dec. 8, 2022, 6 a.m.