Announcement

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

  • Graphs produced dissapear... how do you make them stay as different tabs in the same window?

    Code:
    *go to directory where files are found
    
    cd "C:\Users\bruno\OneDrive\Documents\Investigacion\Articulos Economia\I. Cyclical Unemployment USA\Stata\Final Stata"
    use "variables.dta", replace
    
    
    
    
    **Declare Date to be a quartelry time-series data**
    
    generate DATE = tq(2002q1) + _n-1
    format DATE %tq
    tsset DATE
    label var DATE "Quarterly Data:  1st quarter of 2002 - 1st quarter of 2022"
    
    
    
    **Transform variables into Logarithms (constant elasticities): to stabilize variable variance & rgeression coefficeints**
    
    gen l_cycunrate = ln(CUNRATE)
    gen l_consumption = ln(PCEC96)
    gen l_tcu = ln(TCU)
    gen l_isratio = ln(ISRATIO)
    gen l_investment = ln(GPDIC1)
    gen l_govexp = ln(GCEC1)
    gen l_rgdp = ln(GDPC1)
    gen l_value = ln(VALUE)
    gen l_ulc = ln(ULC)
    gen l_nlc = ln(NLC)
    gen l_cfc = ln(CFC)
    gen l_tpi = ln(TPI)
    gen l_nin = ln(NIN)
    gen l_cp = ln(CP)
    gen l_tci = ln(TCI)
    gen l_pat = ln(PAT)
    
    
    
    **univariate graphs of each variable
    
    set autotabgraphs on
    
    line l_cycunrate DATE
    line l_consumption DATE
    line l_tcu DATE
    line l_isratio DATE
    line l_investment DATE
    line l_govexp DATE
    line l_rgdp DATE
    line l_value DATE
    line l_ulc DATE
    line l_nlc DATE
    line l_cfc DATE
    line l_tpi DATE
    line l_nin DATE
    line l_cp DATE
    line l_tci DATE
    line l_pat DATE
    As the commands are executed line by line, the graphs open and then immediately are closed as the next one is produced. At the end of the code, only the last graph is shown.

    I'm wondering how do I tell Stata to keep each graph produced open, and to tell subsequent ones to open in the same windows(as different tabs in the same window). The effect desired is to have all these graphs in one window.

    I do not wish to merge them, just to make them appear in different tabs in the same window for the sake of convenience.

    Also, is there a way to specify the format in which these graphs can be saved, as in jpg format?

    Thank you kindly Stata community.

    Regards
    Last edited by Bruno Calderon; 17 Jun 2022, 20:44.

  • #2
    Code:
    sysuse auto, clear
    
    scatter price weight, name(gr_one, replace)
    
    sc head price, name(gr_two, replace)

    Comment

    Working...
    X