Statalist The Stata Listserver


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

st: Re: Type Miismatch error after Encode in time series


From   "Sergiy Radyakin" <[email protected]>
To   <[email protected]>
Subject   st: Re: Type Miismatch error after Encode in time series
Date   Mon, 16 Apr 2007 13:54:19 +0200

Hello Michael,

after -encode- your cust_id variable is numeric.
It makes no sense to compare it with a "STRING".
Use your original variable customername or the
corresponding numeric value of cust_id.

Regards,
Sergiy




----- Original Message ----- From: "Michael Crain" <[email protected]>
To: <[email protected]>
Sent: Monday, April 16, 2007 1:41 PM
Subject: st: Type Miismatch error after Encode in time series



I am getting a Type Mismatch error that I cannot solve despite spending a lot of time reading various resources.

I obtained a data set with one field that was a string. I applied Encode to change the string field (containing alpha characters) to a (general) numeric field by doing the following:
encode custormername, gen(cust_id)

This is panel data so I defined the data set as time series with TSSET:
tsset cust_id week

The time series commands performed fine at that point such as ARIMA using BYSORT cust_id, which successfully resulted the arima results by cust_id over the entire data set such as:
bysort cust_id: arima saleamt, ar(1 52), if tin(2002w1, 2004w35)

However, I want to do TS commands for a specific cust_id and entered:
arima saleamt, ar(1 52), if cust_id=="XYZ COMPANY"

But I get the Type Mismatch r(109) error message, whcih I just cannot solve.

Any hekp is very appreciated. Thank you.

_________________________________________________________________
Get a FREE Web site, company branded e-mail and more from Microsoft Office Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/

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



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