Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: RE: compounding interest


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: compounding interest
Date   Fri, 23 Jul 2010 22:40:56 +0200

<>

Jurgen may also want to take a look at the -mata- function -runningprod-,
which has a facility to deal with missings:


***********
ssc inst runningprod

clear*
inp byte x
2
3
.
4
2
end

putmata x
mata:y=runningprod(x, 1)
getmata y
l
***********


HTH
Martin

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Jurgen Sidgman
Sent: Freitag, 23. Juli 2010 20:37
To: statalist@hsphsun2.harvard.edu
Subject: st: compounding interest

Hi,

Does any one know how to multiply two or more values located in the same
column but in different rows?
For example, in the first column I have the following information:
Row 1: 2
Row 2: 3
Row 3: 4
Row 4: 2

What I want to do is to calculate:
Row 1 x Row 2 = 6
Previous result x Row 3 = 24
Previous result x Row 4 = 48

Thank you
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index