EconPapers    
Economics at your fingertips  
 

MATODD: Stata modules to produce various matrix tasks

Nicholas Cox

Statistical Software Components from Boston College Department of Economics

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.

Language: Stata
Requires: Stata 5.0 (Stata 6.0 for matdelrc)
Keywords: matrices; iterative convergence; Bayes smoothing (search for similar items in EconPapers)
Date: 1999-01-17, Revised 2000-01-18
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.
References: Add references at CitEc
Citations:

Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/m/matcfa.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matcfm.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matchk.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matcname.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matdelrc.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matewd.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matewm.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matewop.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matgop.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matmad.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matmps.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matpow.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/mstdizem.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/p/psbayesm.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matcfa.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matcfm.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matchk.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matcname.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matdelrc.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matewd.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matewm.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matewop.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matgop.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matmad.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matmps.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/matpow.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/m/mstdizem.hlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/p/psbayesm.hlp help file (text/plain)

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s367001

Ordering information: This software item can be ordered from
http://repec.org/docs/ssc.php

Access Statistics for this software item

More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().

 
Page updated 2025-03-30
Handle: RePEc:boc:bocode:s367001