-------------------------------------------------------------------------------
help: varprod                                                        dialog: va
> rprod
-------------------------------------------------------------------------------

+-------+ ----+ 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 Assistant Professor Agricultural Research Center - Agricultural Economics Research Institute - Eg > ypt Email: emadstat@hotmail.com WebPage: http://emadstat.110mb.com/stata.htm 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"