> i was wondering what is the procedure that stata using in descding
> datatypes in the insheet command. does it do it based on the datatype of
> the first row of data? if so, then what does it do when the data in teh
> first row is missing?
-insheet- is inclined to treat variables
as numeric unless they are "obviously" string.
But one non-numeric value is enough to make
a variable "obviously" string. A single period
may, however, be interpreted as numeric, because
that indicates numeric missing.
I created this little test.dat
and used -insheet-.
-v1- with values 1,5,10,15 is treated as numeric.
-v2- with values .,6,11,16 ditto.
No surprises so far.
-v3- with values "3",7,12,17 is also treated
as numeric. In effect, the " " are ignored.
Clearly, -insheet- looks beyond the first
Similarly, -v4- with values "4","8","13","18"
is treated as numeric. Even the " " on every
value do not make this a string variable.
In contrast, -v5- with a single non-numeric
value, the "toad" lurking at the bottom,
is treated as string. Clearly, -insheet-
can change its mind even at the last row.
This sensitivity clashes, for example, with
the habit of many spreadsheet users of
interpolating lines of text within their
data files. But treating such a variable as string is the
only way that Stata can do justice to
what you input. Stata is not in the business of
guessing what the data "should" be.
There is, I guess, a question behind your
question. The FAQs at
may help. Start with
* For searches and help try: