help: varprod dialog:

Title

varprod: Generate Row Product of Variables

Syntax

egen [type] newvar = varprod(varlist) [if] [in]

Description

varprod generates (row) product of variables in varlist, and looks like function (rowtotal) in egen command that creates (row) sum of the variables in varlist

Examples

clear all

sysuse varprod.dta , clear

egen px1 = varprod(x1 x2 x3 x4)

egen px2 = varprod(x*)

gen px3 = x1*x2*x3*x4

list px1 px2 px3

egen pxy1 = varprod(x1 x2 x3 x4 y1 y2 y3)

egen pxy2 = varprod(x* y*)

gen pxy3 = x1*x2*x3*x4*y1*y2*y3

list pxy1 pxy2 pxy3

Author

Emad Abd Elmessih Shehata
Professor (PhD Economics)
Agricultural Research Center - Agricultural Economics Research Institute - Egypt
Email: emadstat@hotmail.com
WebPage at IDEAS: http://ideas.repec.org/f/psh494.html
WebPage at EconPapers: http://econpapers.repec.org/RAS/psh494.htm

VARPROD Citation

Shehata, Emad Abd Elmessih (2012)

VARPROD: "Stata Module to Generate Row Product of Variables"

http://ideas.repec.org/c/boc/bocode/s457410.html

http://econpapers.repec.org/software/bocbocode/s457410.htm