He all,
I got a question concerning the replacement of string data, when replacing data i usually insert i.e. k3h=@recode(k3h=na,0,k3h), however i need to replace Don't know. When commanding k3h=@recode(k3h="Don't Know",0,k3h) it responses with 'Numeric operator applied to string data'. Pleace help, i appreciate the effort!
Arnoud
replace string data
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3798
- Joined: Wed Sep 17, 2008 2:25 pm
Re: replace string data
Assuming that k3h is an alpha series, this strikes me as a bug. But try
Code: Select all
series k3hEqualsDontKnow = k3h="Don't know"
k3h=@recode(k3hEqualsDontKnow ,0,k3h)-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: replace string data
I'm not by my computer so I can't test this but I think the second argument needs to be a string, as in
Code: Select all
k3h=@recode(k3h="Don't Know","0",k3h)Re: replace string data
@ eviewsglen & startz
Thanks a lot for the effort, unfortunately both answers do not solve the issue... any other thoughts?
Thanks a lot for the effort, unfortunately both answers do not solve the issue... any other thoughts?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: replace string data
Post your work file
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3798
- Joined: Wed Sep 17, 2008 2:25 pm
Re: replace string data
Glenn's solution works on my machine. If k3h is an alpha series, you can't set it to 0 because that's a number rather than a string.
Who is online
Users browsing this forum: No registered users and 1 guest
