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]

RE: st: RE: changing observations under one variable


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: changing observations under one variable
Date   Tue, 24 Apr 2012 14:44:12 +0100

Your reply to mine arrived before your reply to Tashi's. Similarly I have replied to that post. 

Nick 
n.j.cox@durham.ac.uk 

Rudy Hover

Nick I read your and Tashi's reply and answered your questions. What else do you need to know about the data? 

In stata it looks like

date
29jan1999
26feb1999
31mar1999
..

I need to replace the observations as they now contain data (the day) which I don't want it to contain. 

It should look like

date
199901
199902
199903
..

On Apr 24, 2012, at 2:29 PM, Nick Cox wrote:

> Please read my reply as well as Tashi's and pay attention to the questions asked. You are not telling us enough about your data. Alternatively, try reading the help for -format- to see what Tashi meant. 
> 
> Nick 
> n.j.cox@durham.ac.uk 
> 
> Rudy Hover
> 
> Thank you for the reply tashi
> 
> what do you mean with try format %tdCCYYdd ?
> How can I replace the observations as I meant?
> 
> On Apr 24, 2012, at 2:14 PM, tashi lama wrote:
> 
>> Try format %tdCCYYdd . 
> 
> From: n.j.cox@durham.ac.uk
> 
>>> The word format means so many things! "29jan1999" is not a format in the sense of -format-. It might the result of setting a particular format?
>>> 
>>> Is -date- a string variable? Is it a numeric variable with a date format assigned.
>>> 
>>> Do you want another string variable? Do you want a numeric variable with a specified display -format-?
>>> 
>>> Nick
>>> n.j.cox@durham.ac.uk
>>> 
>>> Rudy Hover
>>> 
>>> I have one variable called 'date' with observations in the format '29jan1999' until '19dec2006', so the last working day of the month, the month and then the year. I want to change this to the format '199901' or '200612', so I don't need the day anymore, only the year and then the month. Could you help me how to replace?
>>> 

*
*   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