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

st: length(s) question

From   "Julia A. Gamas" <>
To   <>
Subject   st: length(s) question
Date   Mon, 25 Oct 2004 16:48:20 -0400

Dear all,

I am trying to determine the length of a string variable because this length
changes in each observation and I want to work with substr, so I need the
variable to be the same size accross observations.  But I'm getting an error
message that I simply don't understand how to fix.

I write:  generate long = length (vp40_11), vp40_11 is the string varible
whose length I want.
Error message reads:  "too few variables specification","r(102)"
However, the help section says to write
"generate varname = exp" and exp in this case is length (s), where "s" is
the string variable.

So I can't really understand which variable is missing.  Can anybody help me

Julia A. Gamas
Program on Urban, Regional and Global Air Pollution
Massachusetts Institute of Technology
77 Massachusetts Avenue 54-1823
Cambridge, MA 02139
Phone: 617-258-0230

*   For searches and help try:

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