Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: [Fwd: Fwd: string variable problem]


From   Marcello Pagano <[email protected]>
To   [email protected]
Subject   st: [Fwd: Fwd: string variable problem]
Date   Tue, 19 Jun 2007 16:42:23 -0400

Begin forwarded message:

From: Kit Baum <[email protected]>
Date: June 19, 2007 1:55:36 PM EDT
To: [email protected]
Subject: re: string variable problem


With Eric's data,

Albania2002
Albania2005
Serbia&Montenegro2002
Serbia&Montenegro2005


g country=substr(var1,1,length(var1)-4)
g year=substr(var1,length(var1)-3,.)


You could also use Macro Extended Functions to "subtract" the year from the string.


Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index