Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re^2: string variables


From   "Katsuhide Isa" <[email protected]>
To   <[email protected]>
Subject   st: Re^2: string variables
Date   Sat, 7 Dec 2002 00:35:43 +0900

To Nick:

> Absolutely. Check out -destring-. Empty 
> strings will map to missings, if that is what 
> you mean by "no response". 

Thank you for your suggestion.
I haven't known of such a covenient command.
I think the richness of this kind of commands for data 
management is one of the advanteges of using Stata.
 
> There is a general discussion of numbers and 
> strings at  
> 
> On numbers and strings. The Stata Journal 2, 314-329
> (2002) 

Oh, I haven't checked this issue yet!
Thank you for your reminder.

> I presume you mean "Stat Transfer". By the way, 
> it is not correct that string variables can't 
> be used with -generate- or -rename- or -forvalues-, 
> it just depends what you are trying to do. 

Sorry. "Stat Transfer". is correct.
And the sentence that 'string variables can't 
 be used with -rename-' is surely incorrect.
But, I'm afraid these string variables can't  be used with 
-generate- or -rename- or -forvalues-, as far as my data 
is concerned.

The relevant part of the data is as follows:

-----------------------------------
                      storage  display     
variable name   type     format      
-----------------------------------
_1              int    %8.0g                  
_2              int    %8.0g                  
_3              int    %8.0g                  
_4              int    %8.0g                  
_5              int    %8.0g                  
_6              int    %8.0g                  
_7              int    %8.0g                  
_8              int    %8.0g                  
_9              int    %8.0g                  
_10             int    %8.0g                  
_11             str15  %15s   
....

Given this structure, when  typed 'gen SQ11 = _11', or
'forvalues i = 1/11 {gen SQ`i' = _`i'}', Stata says,
'type mismatch r(109);'
Maybe I did somehing wrong, but I don't know what the 
cause is.

K.I.

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