This functions makes it simpler to input covariance, correlation, and raw-moment
matrices to be analyzed by the sem
function. The matrix
is input in lower-triangular form on as many lines as is convenient,
omitting the above-diagonal elements. The
elements on the diagonal may also optionally be omitted, in which case they
are taken to be 1.
readMoments(file="", text, diag=TRUE,
names=as.character(paste("X", 1:n, sep = "")))
Returns a lower-triangular matrix (i.e., with zeroes above the main diagonal)
suitable for input to sem
.
The (quoted) file from which to read the moment matrix,
including the path to the file if it is not in the current directory. If
""
(the default) and the text
argument is absent,
then the moment matrix is read from the standard
input stream, and is terminated by a blank line.
The moment matrix given as a character string, as an alternative
to specifying the file
argument or reading the moments from
the input stream --- e.g., when the session is not interactive and there is no
standard input.
If TRUE
(the default), then the input matrix includes
diagonal elements.
a character vector containing the names of the variables, to label the rows and columns of the moment matrix.
John Fox jfox@mcmaster.ca
sem