Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: New version of -prodvars- on SSC

From   Roger Newson <>
To   "" <>
Subject   st: New version of -prodvars- on SSC
Date   Thu, 10 Feb 2011 12:47:07 +0000

Thanks again to Kit Baum, a new version of the -prodvars- package is now available for download from SSC. In Stata, use the -ssc- command to do this, or -adoupdate- if you already have an old version of -prodvars-.

The -prodvars- package is described as below on my website, and is expected to be useful in defining design matrices for multivariate spline models, or for models combining splines for continuous factors with indicator (dummy) variables for discrete factors. The new version adds a -generate()- option, allowing the user to specify that the generated product variables will be prefixed with a stub and suffixed with the sequence number of the generated product variable, ordered primarily in the order of the left input varlist and secondarily in the order of the right input varlist. (In default, names for the product variables are generated from the names of the corresponding input variables.) It also adds options -lcharlist()- and -rcharlist()-, allowing the output product variables to inherit lists of variable characteristics from the corresponding left and right input variables, respectively. In addition, it adds an option -ccharlist()-, allowing the output product variables to have a list of variable characteristics evaluated by combining the variable characteristics of the same names for the corresponding left and right input variables, using the new options -ccprefix()-, -ccsuffix()- and -ccseparator()- to specify prefix, suffix and separator strings, respectively. I have also added a -fast- option, allowing the user to choose whether or not -prodvars- does extra work to preserve the original dataset (without the added product variables( if the user presses -Break-.

Best wishes


Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Web page:
Departmental Web page:

Opinions expressed are those of the author, not of the institution.

package prodvars from

      prodvars: Create product variables for two lists of input variables

      prodvars inputs 2 variable lists, known as the left variable list and
      the right variable list. It produces as output a list of generated
      variables, one for each pair of variables from the left and right
      variable lists, each with a variable names derived either from a stub
      or from the names of the pair of input variables, and values equal to
      the products of the values of the two input variables. Optionally,
      the generated variables may also have variable labels derived from
      the variable labels, or variable names, of the input variables.
      prodvars is useful for calculating variables for the design matrix
      of a multiple-intercept model.

      Author: Roger Newson
      Date: 08 February 2011
      Stata version: 10

INSTALLATION FILES                                  (click here to install)
(click here to return to the previous screen)
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index