EconPapers    
Economics at your fingertips  
 

RANKTEST: Stata module to test the rank of a matrix

Frank Kleibergen, Mark Schaffer () and Frank Windmeijer

Statistical Software Components from Boston College Department of Economics

Abstract: ranktest implements various tests for the rank of a matrix. Tests of the rank of a matrix have many practical applications. For example, in econometrics the requirement for identification is the rank condition, which states that a particular matrix must be of full column rank. Another example from econometrics concerns cointegration in vector autoregressive (VAR) models; the Johansen trace test is a test of a rank of a particular matrix. The traditional test of the rank of a matrix for the standard (stationary) case is the Anderson (1951) canonical correlations test. If we denote one list of variables as Y and a second as Z, and we calculate the squared canonical correlations between Y and Z, the LM form of the Anderson test, where the null hypothesis is that the matrix of correlations or regression parameters B between Y and Z has rank(B)=r, is N times the sum of the r+1 largest squared canonical correlations. A large test statistic and rejection of the null indicates that the matrix has rank at least r+1. The Cragg-Donald (1993) statistic is a closely related Wald test for the rank of a matrix. The standard versions of these tests require the assumption that the covariance matrix has a Kronecker form; when this is not so, e.g., when disturbances are heteroskedastic or autocorrelated, the test statistics are no longer valid. ranktest implements various generalizations of these tests - Kleibergen-Paap, Cragg-Donald, and J-type 2-step GMM and CUE GMM tests - to the case of a non-Kronecker covariance matrix. The implementation in ranktest will calculate test statistics that are robust to various forms of heteroskedasticity, autocorrelation, and clustering.

Language: Stata
Requires: Stata version 12 (version 9.2 for ranktest9, version 11 for ranktest11)
Keywords: matrix; rank; collinearity; cointegration (search for similar items in EconPapers)
Date: 2007-08-30, Revised 2020-09-29
Note: ranktest was substantially rewritten and expanded starting with version 2.0.02, and the version of Stata required was raised to Stata 12. To run the previous version of ranktest, either use version control (version 11: ranktest ...) or call ranktest11 (included in the ranktest package). This module should be installed from within Stata by typing "ssc install ranktest". 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: View citations in EconPapers (5)

Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/r/ranktest.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/r/ranktest9.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/r/ranktest11.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/r/ranktest.sthlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/r/ranktest11.sthlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/l/livreg2.mlib help file (text/plain)
http://fmwww.bc.edu/repec/bocode/c/cs_ranktest_2.0.03.do cert script (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:s456865

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:s456865