amsweep: Sweep operator

Description Usage Arguments Value References

View source: R/utilities-covariance.R

Description

General sweep operator citation:

Usage

1
amsweep(g, m, reverse = FALSE)

Arguments

g

Each unit of a numeric, symmetric covariance matrix divided by the number of observations in the data the covariance matrix was derived from.

m

A logical vector of length equal to the number of rows in g in which the TRUE values correspond to the x values in the matrix and the FALSE values correspond to the y value in the matrix.

reverse

Logical vector specifying whether the sign of the matrix should be flipped. Default to FALSE.

Value

The coefficients from g.

References

Goodnight, James H. "A tutorial on the SWEEP operator." The American Statistician 33, no. 3 (1979): 149-158. This implementation is from pseudocode from:

Schafer, Joseph L. Analysis of incomplete multivariate data. Chapman and Hall/CRC, 1997. Code ported from:

Honaker, James, Gary King, and Matthew Blackwell. "Amelia II: A program for missing data." Journal of statistical software 45, no. 7 (2011): 1-47.

Sweeps a covariance matrix to extract regression coefficients.


privacytoolsproject/PSI-Library documentation built on Feb. 17, 2020, 2:03 p.m.