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, is already up and running.

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

st: Forvalues [was cut function]

From   Katia Bobulova <>
Subject   st: Forvalues [was cut function]
Date   Tue, 3 Aug 2010 16:27:26 +0100

Dear all,

I am still trying to solve my problem to have equal time intervals for
each data.

This is what I have:

   Data            Time
03jan2000       93157
03jan2000       93201
03jan2000       93248
03jan2000       93305
03jan2000       93602
03jan2000       93805
03jan2000       94000

And this is what I want to obtain:

   Data            Time
03jan2000       93000
03jan2000       93100
03jan2000       93200
03jan2000       93200
03jan2000       93300
03jan2000       93400
03jan2000       93500
03jan2000       93600
03jan2000       93700
03jan2000       93800
03jan2000       93900
03jan2000       94000

I thought that a possibler solution would be to construct a variable
with all the time intervals for each data.

I tried to give Stata this command:

forval data: 03jan2000/24feb2000{
gen time2=93000 (1) 94000

The command doesn't work.

Do you know if this could a possible solution to my problem and if
yes, how to write the right code?

Thank you very much.

*   For searches and help try:

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