| infoMxop | R Documentation |
Processes four types of information matrices: ones produced by the SparseM package for the orm function in rms version 6.9-0 and earlier, by the Matrix package for version 7.0-0 of rms using a tri-band diagonal matrix for the intercepts, using Matrix for general sparse information matrices for intercepts (when any interval-censored observations exist), or plain matrices. For Matrix, the input information matrix is a list with three elements: a containing in two columns the diagonal and superdiagonal for intercepts (when there is no interval censoring) or a list with three elements row, col, a (when there is interval censoring), b, a square matrix for the covariates, and ab for intercepts x covariates. If nothing else is specified, the assembled information matrix is returned for Matrix, or the original info otherwise. If p=TRUE, the number of parameters in the model (number of rows and columns in the whole information matrix) is returned. If i is given, the i elements of the inverse of info are returned, using efficient calculation to avoid inverting the whole matrix. Otherwise if invert=TRUE or B is given without i, the efficiently (if Matrix or SparseM) inverted matrix is returned, or the matrix multiplication of the inverse and B. If both i and B are given, what is returned is the i portion of the inverse of the information matrix, matrix multiplied by B. This is done inside solve().
infoMxop(
info,
i,
invert = !missing(i) || !missing(B),
B,
np = FALSE,
tol = .Machine$double.eps,
abort = TRUE
)
info |
an information matrix object |
i |
integer vector specifying elements returned from the inverse. You an also specify |
invert |
set to |
B |
multiplier matrix |
np |
set to |
tol |
tolerance for matrix inversion singularity |
abort |
set to |
When only variance-covariance matrix elements corresponding to the non-intercepts are desired, specify
i='x' or i=(k + 1) : nv where nv is the number of intercepts and slopes combined. infoMxop computes the needed covariance matrix very quickly in this case.
When inverting info, if info has a 'scale' attribute with elements mean and sd, the scaling is reversed after inverting info.
a single integer or a matrix
Frank Harrell
## Not run:
f <- orm(y ~ x)
infoMxop(f$info.matrix) # assembles 3 pieces
infoMxop(v, i=c(2,4)) # returns a submatrix of v inverse
infoMxop(f$info.matrix, i='x') # sub-covariance matrix for just the betas
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.