Announcement

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

  • Plotting sum of regression coefficients with confidence interval

    Hello everyone,

    I am trying to create a graph that shows the total effect of a "Tariff Cut" (dummy variable) for different level of a continuos variable "Redeployability" with which tariff cut is interacted. The model I have estimated is the following:

    Resource allocated = B1 Tariff Cut + B2 Redeployability + B3Tariff Cut*Redeployability + Controls and year dummies

    Basically what I want to plot is: B1 +B3*Redeployability for different levels of redeployability

    In particular what I am struggling with is adding a 95% confidence interval to the graph showing the total effect. Any one that can help me with that?

    Thank you in advance!
    Raffaele





  • #2
    HI Raffaele,

    I recommend you look into using the Stata command -dataex- which can downloaded from SSC using the following command:
    Code:
    ssc install dataex
    I believe the newest version of Stata has this package built-in.

    This code allows you to share a snippet of your data so that we can recreate your model and show you how to achieve your desired outcome. Here is -dataex- applied to the Stata example dataset -auto- (selecting the first 5 lines).
    Code:
    sysuse auto
    dataex , count(5)
    The result is:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str18 make int(price mpg rep78) float headroom int(trunk weight length turn displacement) float gear_ratio byte foreign
    "AMC Concord"   4099 22 3 2.5 11 2930 186 40 121 3.58 0
    "AMC Pacer"     4749 17 3   3 11 3350 173 40 258 2.53 0
    "AMC Spirit"    3799 22 .   3 12 2640 168 35 121 3.08 0
    "Buick Century" 4816 20 3 4.5 16 3250 196 40 196 2.93 0
    "Buick Electra" 7827 15 4   4 20 4080 222 43 350 2.41 0
    end
    label values foreign origin
    label def origin 0 "Domestic", modify

    Of course, if you want to use this with your data it is your responsibility to adhere to data sharing/confidentiality agreements, and it is advised to remove unique IDs. If you provide a snippet of your data, I can help you further.

    Comment

    Working...
    X