Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

colSumsCrossprod

Apply crossprod and colSums


Description

Fast computation of crossprod(colSums(X),Y)

Usage

colSumsCrossprod(X, Y, transposeY)

Arguments

X

A matrix with dimensions k*n. Hence the result of colSums(X) has length n.

Y

A matrix with dimenions n*m. Can be a matrix with dimension m*n but then transposeY should be TRUE.

transposeY

Logical. If TRUE transpose Y before matrix multiplication.

Value

A vector of length m.

Author(s)

Thomas Alexander Gerds <tag@biostat.ku.dk>

Examples

x <- matrix(1:8,ncol=2)
y <- matrix(1:16,ncol=8)
colSumsCrossprod(x,y,0)

x <- matrix(1:8,ncol=2)
y <- matrix(1:16,ncol=2)
colSumsCrossprod(x,y,1)

riskRegression

Risk Regression Models and Prediction Scores for Survival Analysis with Competing Risks

v2020.12.08
GPL (>= 2)
Authors
Thomas Alexander Gerds [aut, cre], Paul Blanche [ctb], Rikke Mortensen [ctb], Marvin Wright [ctb], Nikolaj Tollenaar [ctb], John Muschelli [ctb], Ulla Brasch Mogensen [ctb], Brice Ozenne [aut] (<https://orcid.org/0000-0001-9694-2956>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.