PROGRAMMING


  • The levelsof command is now faster.
  • The Stata–Python API specification has new features and improvements:
    • The ValueLabel class can now work with Stata’s extended missing values using the following methods:
      1. ValueLabel.getLabel(name, value) allows value to be .a.b, …, .z in addition to an integer value so that it can return the labels associated with Stata’s missing values.
      2. ValueLabel.getValueLabels(name) returns Stata’s missing label as a key if the value label contains a missing value associated with a label. Previously, the key was returned as an integer missing value.
      3. ValueLabel.setLabelValue(name, value, label) allows value to be .a.b, …, .z in addition to an integer value so that it can set labels for missing values.
      4. ValueLabel.getValues(name) returns Stata’s missing label in the result if the value label contains a missing value associated with a label. Previously, the value was returned as an integer missing value.
      5. ValueLabel.removeLabelValue(name, value) allows value to be .a.b, …, .z in addition to an integer value so that it can remove labels for missing values.
    • The Missing class has the following improvements:
      1. Missing.getValue(val=None) allows users to input None or ., .a, …, .z to access Stata’s missing values. Previously val could be None, or ab, …, z.
      2. Missing.getMissing(value) gets the missing symbol associated with value that represents the corresponding missing value in Stata.
    • The Data class has a new function, isAlias(var), that returns whether a variable in the current dataset is an alias for a variable in another frame.
    • The Frame class has a new function, isAlias(var), that returns whether a variable in the current dataset is an alias for a variable in another frame.

 

© Copyright 1996–2024 StataCorp LLC. All rights reserved.

  • The Stata–Java API Specification has the following new features:
    • The ValueLabel class can now work with Stata’s extended missing values using the following methods:
      1. ValueLabel.getLabel(java.lang.String, double) gets the label for a specified value-label value.
      2. ValueLabel.getValueLabels(String name, Map<LabelValue,String> map) gets the value and label pairings for a specified value-label name.
      3. ValueLabel.removeLabelValue(String name, Missing.Extended missingValue) removes a value-label value from the specified value-label name.
      4. ValueLabel.setLabelValue(String name, Missing.Extended missingValue, String label) sets a value and label for a value-label name.
    • The LabelValue class was added to encapsulate a Stata value-label value.
    • The Data class has a new function, isAlias(int var), that returns whether a variable in the current dataset is an alias for a variable in another frame.
    • The Frame class has a new function, isAlias(int var), that returns whether a variable in the current dataset is an alias for a variable in another frame.
  • The matlist command has two new options for customizing the display of matrices. The rightindent option indents data by one space relative to the end of row lines. The rowtitleleft option displays row titles flush left.
  • Programmers working with alias variables in frames can take advantage of four new macro functions:
    • isalias varname returns 1 for an alias variable and 0 otherwise.
    • aliasframe varname returns the name of a frame that varname is linked to.
    • aliaslinkname varname returns the name of the linking variable that was used to create varname.
    • aliasvarname varname returns the name of the variable that varname is linked to.