Stata Technical Bulletin
Example
The following example shows the use of a few of the commands on a short artificial data set.
. list
m |
У | |
1. |
2 |
1992 |
2. |
2 |
1994 |
3. |
4 |
1994 |
4. |
7 |
1994 |
ε. |
12 |
1994 |
. Iastbday m y, generate (Ibday)
. list
m |
У |
Ibday | ||
1. |
2 |
1992 |
28 | |
2. |
2 |
1994 |
28 | |
3. |
4 |
1994 |
29 | |
4. |
7 |
1994 |
29 | |
ε. |
12 |
1994 |
30 | |
mdytodow m Ibday у. |
, gen(dow) | |||
list | ||||
m |
У |
Ibday |
do w | |
1. |
2 |
1992 |
28 |
Fri. |
2. |
2 |
1994 |
28 |
Mon. |
3. |
4 |
1994 |
29 |
Fri. |
4. |
7 |
1994 |
29 |
Fri. |
ε. |
12 |
1994 |
30 |
Fri. |
list, |
nolabel | |||
m |
У |
Ibday |
do w | |
1. |
2 |
1992 |
28 |
ε |
2. |
2 |
1994 |
28 |
1 |
3. |
4 |
1994 |
29 |
ε |
4. |
7 |
1994 |
29 |
ε |
ε. |
12 |
1994 |
30 |
ε |
. describe
Contains data
Obs : |
ε |
(max= |
8088) |
Vars : |
4 |
(max= |
99) |
Width: |
12 |
(max= |
200) |
1. m |
float '∕09.Og | ||
2. y |
float |
7.9.0g | |
3. Ibday |
int |
7.8.0g | |
4. do w |
int |
7.8.0g |
Dayslab |
Sorted by:
Note that the new variable dow is an integer, but has been given the label Dayslab.
Each of these date commands may also be used in immediate form. To use the command in immediate form, simply type
the name of the command along with the numbers or strings for the day, month, or year you want converted. The command
will display its results to the screen as well as saving them in the global macros S_l-S_4.
Example
. lastday 2 1992
29
Saturday, February 29, 1992
. disp_s
S_l: 29
S_2: Saturday
S_3: Sat
S_4: Sat.
. today
July 1, 1994
More intriguing information
1. The name is absent2. ENERGY-RELATED INPUT DEMAND BY CROP PRODUCERS
3. Evaluating the Impact of Health Programmes
4. The name is absent
5. An Efficient Secure Multimodal Biometric Fusion Using Palmprint and Face Image
6. The name is absent
7. Direct observations of the kinetics of migrating T-cells suggest active retention by endothelial cells with continual bidirectional migration
8. The name is absent
9. The Functions of Postpartum Depression
10. The Macroeconomic Determinants of Volatility in Precious Metals Markets