Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
EViews Guides BITCH / EViews_Illustrated.pdf
Скачиваний:
243
Добавлен:
03.06.2015
Размер:
13.69 Mб
Скачать

266—Chapter 9. Page After Page After Page

Hint: As usual, EViews knows more than one way to skin a cat. If we hadn’t had any interest in seeing the state-by-state averages, we could have used the @MEANSBY function discussed briefly in Chapter 4, “Data—The Transformational Experience.” The following command would produce the same results as we’ve just seen:

ls lnwage c ed age union @meansby(union,gmstcen,"if not @isna(lnwage)")

Having Contractions

“Contracting” data means mapping many data points into one. Above, when EViews contracted our data from individual to statelevel, it used the default contraction method “Mean.” EViews provides a variety of methods, shown at the right, in the Contraction method field.

Most of the contraction methods operate just as their names imply, but No contractions allowed and Unique values are worth a bit of extra comment. These last two options are primarily for error checking. Suppose, as above, that we want to link from state-by-state data to individual data. There should only be one value from each state, so the default contraction Mean just copies the state value. However,

what if we had somehow messed-up the state-by-state page so that there were two California entries? EViews would average the two entries without any warning. We could instead specify No contractions allowed, which instructs EViews to copy the relevant value, but to display an error message if it finds more than one entry for a state. Unique values is almost the same as No contractions allowed, except that if all the values for a category are identical the link proceeds. In other words, if we had entered California twice with a unionization value of 0.0303, Unique values would proceed while No contractions allowed would fail.

Q: Can I specify my own function in place of one of the built-in contraction methods?

A: No.

A': Mostly no.

You can’t provide your own contraction method, but you may be able to construct a workaround. EViews doesn’t provide for contraction by geometric average, for example, but you can roll your own. A geometric average is defined as

Two Hints and A GotchYa—267

n

xˆ = n xi

= 1

To do this by hand, define a series lnx=log(x) in the source page. Do a contraction using the regular mean method. Finally, exponentiate the resulting series in the destination page, as in geo_av=exp(lnx).

Sometimes, as in this example, this sort of work around is easy—sometimes it isn’t.

Two Hints and A GotchYa

In our examples, the Source ID and Destination ID each specified a single series with the same name. It’s perfectly okay to have different names in these fields. EViews matches according to the values found in the respective series. What’s more, you can put multiple series in both fields. If we entered “AA BB CC” for the source and “One Two Three” for the destination, EViews would match observations where the value of AA matched the value of ONE and the value of BB matched the value of TWO and the value of CC matched the value of THREE.

Normally, observations with NA in any of the Source ID or Destination ID series are tossed out of matches. Check the checkbox Treat NAs as ID Category to tell EViews to treat NA as a valid value for matching.

And then the “gotchya” risk. When you paste by value, the matching and merging is done right away. When you use a link, the matching and merging is re-executed each time a value of the link is called for. Remember that the link specification has a sample built into it and that this sample is re-evaluated each time the link is recomputed. If the observations included in this sample are changing, be sure that the change is as you intended. Sometimes its better to break links to avoid such unintended changes.

Quick Review

A page is fundamentally a workfile within a workfile. You can use multiple pages simply as a convenient way to store different sets of data together in one workfile.

The real power of pages lies in the fact that each page can have a different identifier. Series can be brought from one page to another either by copying the values in the source page into the destination page, or by creating a live link. If you create a link, EViews will fetch a fresh copy of the data every time the link series is referenced.

Not only will EViews copy data, it will also translate data from one identifier to another. Because EViews is big on calendars, it has a bag of tricks for converting one frequency to another.

268—Chapter 9. Page After Page After Page

Even where the identifier is something other than time, you can contract data by supplying a rule for selecting sets of observations and then summarizing them in a single number. For example, you might contract data on individuals by taking state-wide averages. Inversely, you can also expand data by instructing EViews to look up the desired values in a table.

Соседние файлы в папке EViews Guides BITCH