buildSSCP: build the sum of squares and cross products matrix

Description Usage Arguments

View source: R/buildSSCP.R


Build sum of squares and crossproducts matrix (SSCP). From the means, covariances, and n's you can recover the raw sum-of-squares and products matrix for all the variables. Say the matrix of all the variables is X, with mean vector bar(x), and covariance matrix S, based on sample-size n. Then the SSCP matrix is X'X = (n - 1)S + n bar(x) bar(x)'. You then need to add the row/column for the constant, which is just n in the 1, 1 position and n bar(x) elsewhere.


buildSSCP(sample.cov, sample.mean, sample.nobs)



Numeric matrix. A sample variance-covariance matrix. The rownames and colnames must contain the observed variable names.


A sample mean vector.


Number of observations in the full data frame.

zackfisher/MIIVsem documentation built on June 26, 2017, 8:22 p.m.