unable to change tabulation-freezed table value column format

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Jason, EViews Moderator, EViews Pamela

bcchen
Posts: 22
Joined: Tue May 02, 2017 8:34 am

unable to change tabulation-freezed table value column format

Postby bcchen » Mon Aug 28, 2017 12:11 pm

Hi,

I have a question regarding changing the format of a table.
I freeze a frequency tabulation of a date series called "quarter" to a table, (for each "*_ipu" series missing ones) and append them into a spool: missing_qtr_distr
Below are my codes:

Code: Select all

spool missing_qtr_distr
%fieldlist=@wlookup("*_ipu","alpha series")
   for %var {%fieldlist}
   smpl if {%var}=""
   freeze({%var}_qtr) quarter.freq
   {%var}_qtr.setformat(a) "YYYY[Q]Q"
   missing_qtr_distr.append(name={%var}) {%var}_qtr
   next
smpl @all


1) why is that when I do it by "clicking the buttons", the format of that series is showing a date format(as shown below), but when I use command, it shows numbers in the "value" column?

    Tabulation of QUARTER_8_FINAL
    Date: 08/28/17 Time: 12:07
    Sample: 2007Q4 2017Q1 IF MASTERNOTE_IPU=""
    Included observations: 74175
    Number of categories: 38

    Cumulative Cumulative
    Value Count Percent Count Percent
    2007Q4 5185 6.99 5185 6.99
    2008Q1 1917 2.58 7102 9.57
    2008Q2 3014 4.06 10116 13.64
    2008Q3 4203 5.67 14319 19.30
    2008Q4 5330 7.19 19649 26.49
    2009Q1 6308 8.50 25957 34.99
    2009Q2 7251 9.78 33208 44.77
    2009Q3 1000 1.35 34208 46.12
    2009Q4 910 1.23 35118 47.34
    2010Q1 1720 2.32 36838 49.66
    2010Q2 2573 3.47 39411 53.13
    2010Q3 905 1.22 40316 54.35
    2010Q4 1023 1.38 41339 55.73
    2011Q1 1051 1.42 42390 57.15
    2011Q2 1104 1.49 43494 58.64
    2011Q3 1092 1.47 44586 60.11
    2011Q4 1280 1.73 45866 61.83
    2012Q1 1290 1.74 47156 63.57
    2012Q2 1465 1.98 48621 65.55
    2012Q3 1488 2.01 50109 67.56

2) I tried to set the column back to "YYYY[Q]Q" but the number would never change. actually, no matter what format I set, it won't change. However, if I change other columns for the same table, it will change to the desired format(shown below).

Tabulation of QUARTER
Date: 08/28/17 Time: 12:05
Sample: 2007Q4 2017Q1 IF CMMTFLAG_IPU=""
Included observations: 816
Number of categories: 9

Cumulative Cumulative
Value Count Percent Count Percent
732949 0001Q1 0001Q1 0001Q1 0001Q1
733497 0001Q3 0001Q1 0001Q3 0001Q1
733772 0001Q3 0001Q1 0002Q1 0001Q1
733862 0002Q1 0001Q1 0003Q1 0001Q2
734045 0001Q1 0001Q1 0003Q1 0001Q2
734318 0001Q1 0001Q1 0003Q1 0001Q2
734410 0001Q1 0001Q1 0003Q1 0001Q2
734502 0001Q1 0001Q1 0003Q1 0001Q2
734776 0001Q1 0001Q1 0003Q1 0001Q2
Total 0003Q1 0001Q2 0003Q1 0001Q2


Did I coded wrong somewhere? How do I used command to get the value column as quarter?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11410
Joined: Tue Sep 16, 2008 5:38 pm

Re: unable to change tabulation-freezed table value column format

Postby EViews Gareth » Mon Aug 28, 2017 12:56 pm

The only thing you can do is make an alpha series containing the string representation, then do a freq on that:

Code: Select all

alpha a = @datestr(@date, "YYYY[Q]Q")
freeze(tab) a.freq
Follow us on Twitter @IHSEViews

bcchen
Posts: 22
Joined: Tue May 02, 2017 8:34 am

Re: unable to change tabulation-freezed table value column format

Postby bcchen » Mon Aug 28, 2017 1:13 pm

Thank you Gareth.
Your way does solve my problems.

Best,
BC


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 4 guests