IDEAS home Printed from https://ideas.repec.org/c/boc/bocode/s367001.html
 

MATODD: Stata modules to produce various matrix tasks

Author

Listed:
  • Nicholas J. Cox

    (University of Durham)

Programming Language

Stata

Abstract

These matrix programs will work with either Stata 5.0 or Stata 6.0, with the exception of matdelrc, which will run only under Stata 6.0. The programs are a suite and some call others. matcfa checks that (matrix newmat = argname1 + argname2) would execute correctly: that is argname1 and argname2 name matrices with the same dimensions. If not, an error message will be issued. matcfm checks that (matrix newmat = argname1 * argname2) would execute correctly. That is, either both arguments are matrices such that the number of columns of argname1 equals the number of rows of argname2; or one of the two arguments is a scalar and the other is a matrix. If not, an error message will be issued. matchk checks that argname names an existing matrix. If not, an error message will be issued. matcname gives matrix1 the row and column names of matrix2, provided that the two matrices have the same dimensions. If not, an error message will be issued. Given a matrix, matdelrc deletes a specified row, or a specified column, or both. matdelrc requires Stata 6.0. matdelrc will not delete (i.e. annihilate) entire row vectors or entire column vectors. Given matrices A and B of the same order, matewd calculates and displays matrix C with typical element ( C[i,j] = A[i,j] / B[i,j] ) provided that no B[i,j] is equal to 0. C may overwrite A or B. A and B may be the same matrix. Given matrices A and B of the same order, matewm calculates and displays matrix C with typical element ( C[i,j] = A[i,j] * B[i,j] ) C may overwrite A or B. A and B may be the same matrix. Given matrices A and B of the same order and a user-supplied binary operator op, matewop calculates and displays matrix C with typical element ( C[i,j] = A[i,j] op B[i,j] ) provided that no C[i,j] would be missing. C may overwrite A or B. A and B may be the same matrix. Given a column_vector A and a row vector B and a user-supplied binary operator op, matgop calculates and displays the generalized outer product: matrix C with typical element ( C[i,j] = A[i,1] op B[1,j] ) provided that no C[i,j] would be missing. matmad calculates the maximum absolute deviation (MAD) between elements of matrices A and B of the same order. matmad is likely to be most useful for checking the convergence of iterative matrix calculations within programs. matmps calculates the sum of a scalar and a matrix and places it in a second matrix. For a scalar x and a matrix A, the second matrix B has typical element ( B[i,j] = x + A[i,j] ), where the order of the arguments is immaterial and matrix2 may overwrite matrix1. Given a square matrix A and power p matpow calculates and displays the pth power of A. The result is placed in a second matrix. mstdizem takes matrix_input and produces matrix_output, which is matrix_input scaled such that the row totals are given by row_total_vector and the column totals given by column_total_vector. psbayesm takes data_matrix, which should be a set of frequencies, and shrinks or smooths it towards a set of frequencies implied by prior probabilities. This will have the effect of replacing sampling zeros by positive estimates whenever the priors are positive.

Suggested Citation

  • Nicholas J. Cox, 1999. "MATODD: Stata modules to produce various matrix tasks," Statistical Software Components S366801, Boston College Department of Economics, revised 18 Jan 2000.
  • Handle: RePEc:boc:bocode:s367001
    Note: This module may be installed from within Stata by typing "ssc install matodd". The module is made available under terms of the GPL v3 (https://www.gnu.org/licenses/gpl-3.0.txt). Windows users should not attempt to download these files with a web browser.
    as

    Download full text from publisher

    File URL: http://fmwww.bc.edu/repec/bocode/m/matcfa.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matcfm.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matchk.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matcname.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matdelrc.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matewd.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matewm.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matewop.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matgop.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matmad.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matmps.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matpow.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mstdizem.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/p/psbayesm.ado
    File Function: program code
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matcfa.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matcfm.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matchk.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matcname.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matdelrc.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matewd.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matewm.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matewop.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matgop.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matmad.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matmps.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/matpow.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mstdizem.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/p/psbayesm.hlp
    File Function: help file
    Download Restriction: no
    ---><---

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:bocode:s367001. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/debocus.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.