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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: Generating new variables with values of difference in 2 variables


From   Hitesh Chandwani <hchandwani.stata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Generating new variables with values of difference in 2 variables
Date   Wed, 18 Apr 2012 10:59:09 -0500

Hello all,

This is another query about loops. I have 8 variables day1-day8. I am
trying to run a loop that does:

gen var1=day2-day1
gen var2=day3-day2
gen var3=day4-day3...and so on.



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