Panel Data

Size

pdAllBalanced Returns an indicator of whether all groups in a panel dataset covers the maximum time span.
pdAllConsecutive Returns an indicator of whether all groups in a panel dataset covers consecutive time periods.
pdIsBalanced Returns an indicator of whether each group in a panel dataset covers the maximum time span.
pdIsConsecutive Returns an indicator of whether each group in a panel dataset covers consecutive time periods.
pdSize Returns the number of groups, number of time observations for each group, an indicator of strong balance.
pdTimeSpans Returns the start date and end date of each requested variable.

Transformation

aggregate Aggregates the data in the columns of a matrix or dataframe based upon a column containing group ids with a choice of method.
dfLonger Converts a GAUSS dataframe in long panel format to wide panel format.
dfWider Converts a GAUSS dataframe in wide panel format to long panel format.
pdBalance Balances an unbalanced panel, ensuring that each group has the same time periods. This can be accomplished by filling in or dropping observations.
pdDiff Computes time series differences of panel data.
pdLag Computes time series lags of panel data.
reclassify Replaces specified values of a matrix, array or string array.
reclassifyCuts Replaces values of a matrix or array within specified ranges.

Merging and Sorting

dfappend Vertically concatenates (or stacks) two dataframes.
innerJoin Performs a left, or full, outer join on two matrices based upon user-specified key columns.
insertcols Inserts one or more new columns into a matrix or dataframe at a specified location.
outerJoin Joins two matrices, or dataframes based upon user-specified key columns, with non-matching rows removed.
pdSort Sorts panel data based on automatically detected group and date variable.
sortmc Sorts a matrix on multiple columns.
where Returns elements from a or b, depending on condition.

Duplicate observations

dropduplicates Drops duplicate observations from data.
getduplicates Identifies duplicate observations and prints report.
isunique Checks if all observations in the matrix or dataframe are unique.
isrowunique Returns a binary vector with a one for every row that is unique, otherwise a zero.

Summary Statistics

aggregate Aggregates the data in the columns of a matrix or dataframe based upon a column containing group ids with a choice of method.
pdSummary Returns summary statistics for panel data, including overall, between-group, and within-group statistics.

Tabulation

frequency Generates frequency table.
plotFreq Creates frequency plot for specified categorical variable.
tabulate Computes and returns two-way tables of frequencies.

Missing values

isinfnanmiss Returns true if the argument contains an infinity, NaN, or missing value.
ismiss Returns 1 if matrix has any missing values, 0 otherwise.
miss, missrv Creates a scalar missing value, or converts (or replaces) specified elements in a matrix to GAUSS’s missing value code.
missex Converts numeric values to the missing value code according to the values given in a logical expression.
msym Controls the symbol printed to represent missing values.
packr Deletes the rows of a matrix that contain any missing values.
scalmiss Returns 1 if the input is a scalar missing value.

Searching

between Indicates whether elements in a matrix fall between a specified lower and upper bound.
contains Indicates whether one matrix, multidimensional array or string array contains any elements from another symbol.
counts Returns number of elements of a vector falling in specified ranges.
countwts Returns weighted count of elements of a vector falling in specified ranges.
indexcat Returns indices of elements falling within a specified range.
indnv Checks one numeric vector against another and returns the indices of the elements of the first vector in the second vector.
isempty Checks whether a symbol is an empty matrix.
ismember Checks whether each element of a matrix or string array matches any element from a separate symbol.
maxindc Returns row number of largest element in each column of a matrix.
minindc Returns row number of smallest element in each column of a matrix.
rowcontains Checks whether any element in the row of a matrix or string array matches any element from a separate symbol.

String and categorical variables

getcollabels Returns the unique set of column labels and corresponding key values for a categorical variable.
recodeCatLabels Replaces the labels in a categorical variable of a dataframe.
reorderCatLabels Changes the order of the labels in a categorical variable of a dataframe.
setBaseCat Sets a specified category to be the base case for a categorical variable.

These functions can be used to fix errors in categorical labels.

strreplace Replaces a substring within a categorical label or string element.
strtof Converts a string or categorical variable of a dataframe to a numeric variable.
strtrim Strips all white space characters from the left and right side of each element in a categorical variable or string array.
strtriml Strips all white space characters from the left side of each element in a categorical variable or string array.
strtrimr Strips all white space characters from the right side of each element in a categorical variable or string array.