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

From |
"Nick Cox" <n.j.cox@durham.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

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

Date |
Wed, 3 Jul 2002 16:59:37 +0100 |

I wrote in response to Lee Chuntao > > > 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 > > > > > > i wonder if there is some sort way so that i can use the laged > > > string variable? > > > > Yes. -destring- your string variable first. Stata quite reasonably > > wants you to have your variables with numeric meaning held as numeric. > > to which he replied > But Why shoud my variable be numeric, that is not reasonable. In > fact, my variable is industry code, never ever be numeric. > > I do not think Nick's answer helpful > > In this aspect, i think stata should admit its shortcomings and > fix the problem asap Sorry to seem unhelpful, but in my judgement there is no problem to be fixed, except possibly some misunderstanding. Time series operators apply to variables which change over time. I can imagine problems in which it is reasonable to imagine that industry code is a variable which changes over time. For example, a person might change their employment and so their associated industry code changes. The associated model might be a Markov chain or something of the sort, but this kind of model does not feature strongly in Stata's time series commands. It seems much likely that industry code is a covariate in some model of Lee's, and not a response or dependent variable. We can only make progress by learning what Lee wants to do, precisely, i.e. what Stata commands he wants to apply to what response variable, what time variable, what covariates. Nick n.j.cox@durham.ac.uk * * 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: may not use time-series operators on string variables***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**References**:**st: Re: RE: may not use time-series operators on string variables***From:*"Lee Chuntao" <chtl@econ.hku.hk>

- Prev by Date:
**st: downtime** - Next by Date:
**st: Using weights from the Current Population survey** - Previous by thread:
**st: Re: RE: may not use time-series operators on string variables** - Next by thread:
**st: RE: RE: Re: RE: may not use time-series operators on string variables** - Index(es):

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