Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Storing values from a table

    Hello all,

    I am attempting to computer IRF graphs for the variables that comprise factors in a 2-step factor-augmented vector autogression. The IRF GRAPH function in Stata will not allow me to do this - it will only create IRF graphs for the factors (responding to some policy innovation) rather than for the variables comprising my factors.

    I think the solution here is to use the factor loading for each variable from each factor and also use the irf tables for each factor to create a linear combination of values that show me how each variable responds to a policy innovation and then graph these values over time. This should produce IRF graphs.

    So, I have two sets of tables. The first table contains factor loadings for each of my variables (I have about 90 variables and 3 factors - so 3 factor loadings for each of those 90 variables).

    Here is an example of my table containing factor loadings:

    Click image for larger version

Name:	Screen Shot 2017-02-18 at 2.49.03 PM.png
Views:	1
Size:	19.2 KB
ID:	1374897





    Next, I have a table that contains the magnitude of how each of my three factors responds to a policy innovation over time:


    I use this code: irf table sirf, set(var1.irf) impulse(FEDFUNDS) response(FI1 FI2 FI3) std
    To produce this table:
    Click image for larger version

Name:	Screen Shot 2017-02-18 at 2.49.26 PM.png
Views:	1
Size:	38.0 KB
ID:	1374896



    Now, what I need to do is somehow store the factor loadings for each variable so that I can multiply those factor loadings for each variable with their respective responses to innovations in the IRF table. Repeating this for all of my variables and graphing should produce my desired graphs.



    An example:

    Consider variable E. If I want to graph how my variable E responds to an innovation in FEDFUNDS I should have:
    E_t1 = (-.002676 *.9639) + (.012273 *.0073) + (.0046*.016512)
    E_t2 =...
    .
    .
    .
    E_t10....





    Does anyone have a good idea about how I can store the values from these tables into vectors that would make such an exercise less painless than just a brute force/manual approach?

  • #2
    If you look at other threads on Statalist, you will see that answers are often given as sample code, tested on sample data provided by the original poster. The alternative to providing code is to write an essay about the program you would write if you had the data to write it, and nobody likes essay tests. And since Stata lacks an import picture command to transform your pictures into usable data, retyping data from a picture is even less attractive to the respondents.

    Please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. Note especially sections 9-12 on how to best pose your question. The more you help others understand your problem, the more likely others are to be able to help you solve your problem. It would be particularly helpful to post a small hand-made example, perhaps with just a two or three of your variables and a few observations, along with the factor loadings for those variables, showing the data before the process and how you expect it to look after the process. In particular, please read FAQ #12 and use dataex and CODE delimiters when posting to Statalist.

    With all that said, the abstract to the essay I would write, were I so inclined, would suggest that the solution involves some combination of storing your table as a Stata dataset, then merging it with your original data.

    Comment


    • #3
      William -

      Very fair points. I will read through the FAQ and then update this question to that it better aligns with forum standards. Thanks for the feedback.

      Comment

      Working...
      X