Page 1 of 1

for loop windsorising

Posted: Fri Sep 16, 2011 7:54 am
by met
Hi there,

What is my error in the following for loop?

Code: Select all

for %y db_09 sg_09 hr_09 series w(%y) = @recode(%y>@quantile(%y,.995),@quantile(%y,.995),@recode(%y<@quantile(%y,.005),@quantile(%y,.005),%y)) next
I get the error message "Can not assign string expression to numeric variable". How do I assign the values of the series?

Code: Select all

series wdb_09 = @recode(db_09>@quantile(db_09,.995),@quantile(db_09,.995),@recode(db_09<@quantile(db_09,.005),@quantile(db_09,.005),db_09))
Thanks, so much!

Re: for loop windsorising

Posted: Fri Sep 16, 2011 7:57 am
by EViews Gareth
Where ever you have %y on the right hand side, replace it with {%y}.

Re: for loop windsorising

Posted: Fri Sep 16, 2011 8:10 am
by met

Code: Select all

for %y db_09 sg_09 hr_09 series w(%y) = @recode({%y}>@quantile({%y},.995),@quantile({%y},.995),@recode({%y}<@quantile({%y},.005),@quantile({%y},.005),{%y})) next
I get the same error message! Working in Eviews 6!

Re: for loop windsorising

Posted: Fri Sep 16, 2011 8:17 am
by EViews Gareth
Replace the (%y) you have on the left hand side with {%y}.

Re: for loop windsorising

Posted: Fri Sep 16, 2011 8:36 am
by met
Works fine now! thanks Gareth