AdaemmerP / lpirfs

40 stars 21 forks source link

How to derive NW standard errors for impulse responses? #18

Closed chryssaka closed 3 years ago

chryssaka commented 3 years ago

Hi,

Could you please give an example of how can I extract the standard errors for the impulse responses that I calculate in lp_lin_iv function? I am new in R and I am using this package for my thesis.

Thank you for creating this package it's very helpful.

AdaemmerP commented 3 years ago

The output of the function provides the impulse responses as well as the upper and lower bounds which uses the standard errors. Just type:

results_lin_iv$irf_lin_mean results_lin_iv$irf_lin_low results_lin_iv$irf_lin_up

chryssaka commented 3 years ago

I need to present in a table next to the impulse responses (results_lin_iv$irf_lin_mean) just the standard errors. (the lower and up bounds I will use them in a plot. )

Thank you for your immediate reply.

AdaemmerP commented 3 years ago

Just take the difference and divide by the value you gave to the function for 'confint':

(results_lin_iv$irf_lin_up - results_lin_iv$irf_lin_mean)/confint