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

st: bug in xpose.ado?


From   Patrick Joly <pat.joly@utoronto.ca>
To   statalist@hsphsun2.harvard.edu
Subject   st: bug in xpose.ado?
Date   Wed, 6 Nov 2002 14:39:11 -0500

-xpose- seems to object when the _varname variable contains the 
string values v1, v2, ..., vN.  For instance,

clear
set type double
set obs 10
g str1 _varname = ""
replace _varname = "v" + string(_n)
g myvar = _n

. list
     _varname      myvar
1.         v1          1
2.         v2          2
3.         v3          3
4.         v4          4
5.         v5          5
6.         v6          6
7.         v7          7
8.         v8          8
9.         v9          9
10.       v10         10

(the actual values of myvar are irrelevant, as long as myvar is a 
numerical variable)

. xpose, clear
v1 already defined
r(110);

However, v1 appears only once within _varname.  The only restriction on 
the values of _varname is that they must be 'legal' names (right?) and 
v1 is a perfectly legal name.

This situation arises since I must: 1) load data which does not 
necessarily contain names for each variable (via -insheet-); 2) 
transpose it once; 3) perform certain operations; and 4) transpose it 
again.  I cannot append a prefix or a suffix to the string values in 
_varname since some may already be at the 32-character limit for names.

Pat Joly
pat.joly@utoronto.ca
joly.patrick@ic.gc.ca



*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index