Command Reference : Matrix Language Summary : Matrix Function Summary
  
Matrix Function Summary
Matrix Utility
@capplyranks Reorder the rows of the matrix using a vector of ranks.
@columnextract Extract column from matrix.
@columns Number of columns in matrix object or group.
@convert Converts series or group to a vector or matrix after removing NAs.
@eqna Test for equality of data objects, treating NAs and null strings as ordinary and not missing values.
@explode Square matrix from a sym matrix object.
@fill Vector initialized from a list of values.
@filledmatrix Matrix initialized with scalar value.
@filledrowvector Rowvector initialized with scalar value.
@filledsym Sym initialized with scalar value.
@filledvector Vector initialized with scalar value.
@getmaindiagonal Extract main diagonal from matrix.
@grid Vector containing equally spaced grid of values.
@hcat Vertically concatenate matrices.
@identity Identity matrix
@implode Creates sym from lower triangle of square matrix.
@implodeu Creates sym from upper triangle of square matrix.
@isna Test for missing values.
@lower Lowercase representation of a string, or lower triangular matrix of a matrix.
@makediagonal Create a matrix with vector placed on a diagonal.
@mnrnd Matrix of normal random numbers.
@neqna Inequality test (NAs and blanks treated as values, not missing values).
@ones Matrix or vector of ones.
@permute Permutation of matrix.
@range Vector of sequential integers.
@ranks Ranking of values.
@rapplyranks Reorder the columns of a matrix using a vector of ranks.
@resample Randomly draw from the rows of the matrix.
@rmvnorm Multivariate normal random draws.
@rowextract Extract rowvector from matrix object.
@rows Number of rows.
@rwish Wishart random draw.
@subextract Extract submatrix from matrix object.
@scale Scale rows or columns of matrix.
@seq Vector containing arithmetic sequence.
@seqm Vector containing geometric sequence.
@sfill Create a string vector from a list of strings.
@sort Sort elements of data object.
@unvec Unstack vector into a matrix.
@unvech Unstack vector into lower triangle of sym.
@uniquevals Vector or svector of unique values of object.
@unitvector Extracts column from an identity matrix.
@upper Uppercase representation of a string; or upper triangular matrix of a matrix.
@vcat Vertically concatenate matrices.
@vec Vectorize (stack columns of) matrix.
@vech Vectorize (stack columns of) lower triangle of matrix.
@zeros Matrix or vector of zeros.
Matrix Algebra
@cholesky Cholesky factor of matrix.
@commute Commutation matrix.
@cond Condition number of square matrix or sym.
@det Determinant of matrix.
@duplic Duplication matrix.
@duplicinv Inverse duplication matrix.
@eigenvalues Vector of eigenvalues of a sym.
@eigenvectors Matrix whose columns contain the eigenvectors of a matrix.
@elimin Elimination matrix.
@inner Inner product.
@inverse Inverse of matrix.
@issingular Test matrix for singularity.
@kronecker Kronecker product.
@lu LU decomposition of a matrix.
@norm Norm of series or matrix object.
@outer Outer product of vectors or series.
@pinverse Moore-Penrose pseudo-inverse of matrix.
@qform Quadratic form.
@qr QR decomposition.
@rank Rank of a matrix.
@rsweep Reverse sweep operator.
@solvesystem Solve system of linear equations.
@svd Singular value decomposition (economy) of matrix.
@svdfull Singular value decomposition (full) of matrix.
@sweep Sweep operator.
@trace Computes the trace of a square matrix or sym.
@transpose Transpose of a matrix object.
@unvec Unstack vector into a matrix.
@unvech Unstack vector into lower triangle of sym.
@vec Vectorize (stack columns of) matrix.
@vech Vectorize (stack columns of) lower triangle of matrix.
Matrix Statistics
@columns Number of columns in matrix object or group.
@cor Correlation of two vectors or series, or between the columns of a matrix or series in a group.
@cov Covariance (non-d.f.corrected) of two vectors or series, or between the columns of a matrix or series in a group.
@covp Covariance (non-d.f. corrected) of two vectors or series, or between the columns of a matrix or series in a group.
@covs Covariance (d.f. corrected) of two vectors or series, or between the columns of a matrix or series in a group.
@first The first non-missing value in the vector or series.
@gmean Geometric mean.
@hmean Harmonic mean.
@ifirst Index of the first non-missing value in the vector or series.
@ilast Index of the last non-missing value in the vector or series.
@imax Index of maximum value.
@imaxes Indices of maximum value (multiple).
@imin Index of minimum value.
@imins Indices of minimum value (multiple).
@inner Inner product.
@intercept Intercept from a trend regression.
@kurt Kurtosis.
@last The last non-missing value in the vector or series.
@mae Mean of absolute error (difference) between series.
@mape Mean absolute percentage error (difference) between series.
@max Maximum value.
@maxes Maximum values (multiple).
@mean Arithmetic mean.
@median Median.
@min Minimum value.
@mins Minimum values (multiple).
@mse Mean of square error (difference) between series.
@nas Number of missing observations.
@norm Norm of series or matrix object.
@obs Number of observations.
@prod Product.
@quantile Empirical quantile.
@regress Perform an OLS regression on the first column of a matrix versus the remaining columns.
@rmse Root of the mean of square error (difference) between series.
@rows Number of rows.
@skew Skewness.
@smape Symmetric mean absolute percentage error (difference) between series.
@stdev Sample standard deviation (d.f. adjusted).
@stdevp Population standard deviation (no d.f. adjustment).
@stdevs Sample standard deviation (d.f. adjusted).
@stdize Standardized data (using sample standard deviation).
@stdizep Standardized data (using population standard deviation).
@sum Arithmetic sum.
@sumsq Arithmetic sum of squares.
@theil Theil inequality coefficient (difference) between series.
@trendcoef Trend coefficient from detrending regression.
@trmean Trimmed mean.
@uniquevals Vector or svector of unique values of object.
@var Population variance (no d.f. adjustment).
@varp Population variance (no d.f. adjustment).
@vars Sample variance (d.f. adjusted).
Matrix Column Statistics
@cfirst First non-missing value in each column of a matrix.
@cifirst Index of the first non-missing value in each column of a matrix.
@cilast Index of the last non-missing value in each column of a matrix.
@cimax Index of the maximal value in each column of a matrix.
@cimin Index of the maximal value in each column of a matrix.
@cintercept Intercept from a trend regression performed on each column of a matrix.
@clast Last non-missing value in each column of the matrix.
@cmax Maximal value in each column of a matrix.
@cmean Mean in each column of a matrix.
@cmedian Median of each column of a matrix.
@cmin Minimal value for each column of the matrix.
@cnas Number of NA values in each column of a matrix.
@cobs Number of non-NA values in each column of a matrix.
@cprod Product of elements in each column of a matrix.
@cquantile Quantile of each column of a matrix.
@cstdev Sample standard deviation (d.f. corrected) of each column of a matrix.
@cstdevp Population standard deviation (non-d.f. corrected) of each column of a matrix.
@cstdevs Sample standard deviation (non-d.f. corrected) of each column of a matrix.
@csum Sum of the values in each column of a matrix.
@csumsq Sum of the squared values in each column of a matrix.
@ctrendcoef Slope from a trend regression on each column of a matrix.
@ctrmean Trimmed mean of each column of a matrix .
@cvar Population variance of each column of a matrix.
@cvarp Population variance of each column of a matrix.
@cvars Sample variance of each column of a matrix.
Matrix Element
@ediv Element by element division of two matrices.
@eeq Element by element equality comparison of two data objects.
@eeqna Element by element equality comparison of two data objects with NAs treated as ordinary value for comparison.
@ege Element by element tests for whether the elements in the data objects are greater than or equal to corresponding elements in another data object.
@egt Element by element tests for whether the elements in the data object strictly greater than corresponding elements in another data object.
@einv Element by element inverses of a matrix.
@ele Element by element tests for whether the elements in the data object are less than or equal to corresponding elements in another data object.
@elt Element by element tests for whether the elements in the data object are strictly less than corresponding elements in another data object.
@emax Element by element maximums of two conformable data objects.
@emin Element by element minimums of two conformable data objects.
@emult Element by element multiplication of two matrix objects.
@eneq Element by element inequality comparison of two data objects.
@eneqna Element by element inequality comparison of two data objects with NAs treated as ordinary value for comparison.
@epow Raises each element in a matrix to a power.
@erecode Element by element recode of data objects.
Matrix Transformation
Overall Transformations
@capplyranks Reorder the rows of the matrix using a vector of ranks.
@demean Compute deviations from the mean of the data object.
@detrend Compute deviations from the trend of the data object.
@dupselem Identifier for the observation within the set of duplicates.
@dupsid Identifier for the duplicates group for the observation.
@dupsobs Number of observations in the corresponding duplicates group.
@permute Permutation of matrix.
@ranks Ranking of values.
@rapplyranks Reorder the columns of a matrix using a vector of ranks.
@resample Randomly draw from the rows of the matrix.
@transpose Transpose of a matrix object.
By-Column Transformations
@colcumprod Cumulative products for each column of a matrix.
@colcumsum Cumulative sums for each column of a matrix.
@coldemean Demean each column of a matrix.
@coldetrend Detrend each column of a matrix.
@colpctiles Percentile values for each column of a matrix.
@colranks Ranks of each column of the matrix.
@colsort Sort each column of the matrix.
@colstdize Standardize each column using the sample (d.f. corrected) standard deviation.
@colstdizep Standardize each column using the population (non-d.f. corrected) standard deviation.
By-Row Transformations
@rowranks Matrix where each row contains ranks of the column values.
@rowsort Matrix where each row contains sorted columns.