test.contrast: Test a contrast

Description Usage Arguments Value References Examples

View source: R/testContrast.R

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

1
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

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

statOmics/MSqRob documentation built on Nov. 24, 2018, 6:52 a.m.