fa_tester: Tests whether a user-specified factor analysis function is...

Description Usage Arguments Details Value Author(s)

View source: R/fa_tester.R

Description

This function tests that the output of fa_func is compatible with the confounder adjustment methods in this package. In general, fa_func needs to take as input at least a matrix Y, which is dimensions n by p, and the rank of the factor analysis r. fa_func needs to return three elements, a matrix alpha that is p by r, a matrix Z that is n by r, and a numeric vector sig_diag that is of length p.

Usage

1
fa_tester(fa_func, fa_args = list(), test_ortho = TRUE)

Arguments

fa_func

The factor analysis function to be tested.

fa_args

A list of additional arguments to pass to fa_func.

test_ortho

A logical. Should we test for left orthogonal equivariance (TRUE), or not (FALSE)?

Details

This function also tests for orthogonal equivariance. See Gerard and Stephens (2016) for a definition of left orthogonal equivariance. You can turn off this test with test_ortho = FALSE, but any factor analysis that is not left orthogonally equivariant would be dubious as the rotation onto the null space is completely arbitrary.

Value

A list with some or all of the following elements:

ok A logical. A value of TRUE means the function is OK. A value of FALSE means the function is not OK.

why A string vector giving the reason(s) why the function is not OK if ok = FALSE.

input A list of input values to help you debug.

Author(s)

David Gerard


dcgerard/vicar documentation built on July 7, 2021, 1:08 p.m.