Page 1 of 1

Replace na by * in matrix/table

Posted: Mon Aug 05, 2013 3:40 am
by andrekan
Hi,

I load a matrix into EViews, then I convert it to a table and save it in LaTex format. My problem is that I want to replace missing values (na) by an asterisk, so I don't have to do this manually in the tex file after the conversion. Any ideas on how I could do it?

The relevant part of the code reads:

matrix(25,11) mat_Midwest_CI
mat_Midwest_CI.read(c2,s=For paper) "Analyses/Results\Time series\Midwest.xls"
freeze(tab_Midwest_CI_help) mat_Midwest_CI

I tried to use the @nan command to replace na values by * in the matrix, but it works for numeric variables only, i.e. writing @nan(mat_Midwest_CI, *) won't work. It doesn't seem like the @nan command works for the table either.

I'd be happy for all suggestions.

-André-

Re: Replace na by * in matrix/table

Posted: Mon Aug 05, 2013 8:06 am
by EViews Gareth
I think you'll have to loop through the elements of the table one by one checking whether they are equal to "NA", and if they are, replacing them with "*".