Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Identify Categorical/Dichotomous and Continuous Variables


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   Re: st: Identify Categorical/Dichotomous and Continuous Variables
Date   Sun, 5 Oct 2008 15:54:18 +0200

Also, note that the distinction would not be easily achieved (how does SPSS go about this business?): Take the auto data,

sysuse auto, clear
ta rep78
ta foreign

Usually, people use the rep78 variable as an example for categorical data, whereas the foreign var acts as an example of a dichotomous variable. But what about mpg or price?

codebook mpg price

shows you that they take on 74 and 21 unique values, respectively. So we would probably say that price is continuous? How about mpg? 21 distinct values in 74 observations? Classification as you report from SPSS does not absolve you of the ground work of thinking about the nature of the variable in question...




HTH
Martin
_______________________
----- Original Message ----- From: "Svend Juul" <[email protected]>
To: <[email protected]>
Sent: Sunday, October 05, 2008 3:44 PM
Subject: Re: st: Identify Categorical/Dichotomous and Continuous Variables



Frank wrote:

I am new to Stata: moved from SPSS a week ago. I am hoping
that someone can help me with what I imagine is a simple
issue. I saved an SPSS file as a Stata one. I am working
my way through the user guide and the data management
manual, but I am having difficulty with confirming whether
Stata recognizes variables as continuous (or scale) or
categorical/dichotomous (or nominal). In SPSS, you can
easily identify whether the type of measure is a scale,
nominal, or string with its drop down menu in the variable
view. It would be a great help, and I would appreciate it
very much if someone would tell me the method to confirm
the data type for categorical/dichotomous and for
continuous variables? Thank you.

======================================================

As Martin responded: Stata has no formal distinction between
continuous and categorical numeric variables. However, the
command

   codebook, compact

may tell you what you want. The -Unique- column tells you
how many "unique" (meaning different) values each variable
has.

Hope this helps
Svend

________________________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000 Aarhus C,  Denmark
Phone, work:   +45 8942 6090
Phone, home:   +45 8693 7796
Fax:           +45 8613 1580
E-mail:        [email protected]
_________________________________________________________

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


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