Statalist


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

RE: st: Simple questions regarding time series data


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Simple questions regarding time series data
Date   Fri, 17 Jul 2009 11:53:32 +0100

This answered the question well. But note also that it is not necessary
and not usually a good idea to put a single text string in a variable. 

di "The forecast GDP for 2009 is " 

illustrates technique. Check out the help for -display-. 

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

Ulrich Kohler replied to Shruthi JAYARAM 

> 2. Is it possible to concatenate strings and numbers into a larger
string?
> For example, I have a variable y and I want to get the output "The
> forecasted GDP for 2009 is y". Can I write a command that intuitively
> carries out this: gen outputstring = paste("The forecast GDP for 2009
is",
> y)

. gen outputstring = "The forcast GDP for 2009 is " + string(y)

see -help operators- and -help string functions-.


*
*   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   |   What's new   |   Site index