Processes four types of information matrices: ones produced by the SparseM package for the orm or lrm functions 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().
Arguments
- info
an information matrix object
- i
integer vector specifying elements returned from the inverse. You an also specify
i='x'to return non-intercepts ori='i'to return intercepts.- invert
set to
TRUEto invertinfo(implied wheniorBis given)- B
multiplier matrix
- np
set to
TRUEto just fetch the total number of parameters (intercepts + betas)- tol
tolerance for matrix inversion singularity
- abort
set to
FALSEto run thesolvecalculation throughtry()without aborting; the user will detect that the operation did not success by examinineinherits(result, 'try-error')for beingTRUE.
Details
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.
When the number of intercepts is needed to be known and the info object is not a 3-element list, info must have an intercepts attribute to define the number. This is used for example when transx=TRUE is specified to lrm or lrm.fit.