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

From |
HF <Hakon.Finne@sintef.no> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: RE: RE: RE: RE: Re: RE: may not use time-series operators on string variables |

Date |
Thu, 4 Jul 2002 14:22:53 +0200 |

> Lee Chuntao's original question: > > > > In my dataset there is a variable v1, which is a string > > variable. I try to use l.v1, after i set the time variable (eg, > > tsset time). I don't know why stata do not permit timeseries > > operators on string variables, it seems not reasonable for the > > lag or lead operators, beyond the difference operators < various answers > Stata has a number of data types (byte, int, long, float, double, str) but no explicit syntactical elements for variable types (nominal, ordinal, interval, ratio). For computational convenience, most of Stata's statistical and graphing procedures only work if the variable is stored as a non-string data type, even if some statistical concepts in themselves do not require numerical values. But some procedures (e.g. -tabulate-) work on strings as well and you might never suspect there could be a problem. The example from the current thread: Time series data on the state of a unit could be any of the four variable types. Events could then be calculated as a change in state from one time to another, but if you want to do this with time-series operators in Stata, the variable has to be stored as a numerical data type. As long as there is no syntactical way to distinguish the four variable types, there are other means. Value labels help translate numbers to text for the reader as a compensation for having to convert textual information to numerical form. The data management tools for performing these conversions in Stata abound but perhaps someone could think about drafting an FAQ or a tutorial on how to use them in the context of variable types (e. g., "What do I do with my categorical/nominal variables to make them work and display properly in Stata?"). (There are some already, e.g. on pie charts.) -- H?kon hakon.finne@sintef.no * * 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/

**Follow-Ups**:**st: RE: RE: RE: RE: RE: Re: RE: may not use time-series operators on string variables***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**Re: st: offset variables** - Next by Date:
**Re: st: the xi: command** - Previous by thread:
**st: Fixed value - time series** - Next by thread:
**st: RE: RE: RE: RE: RE: Re: RE: may not use time-series operators on string variables** - Index(es):

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