Hi everyone,

I basically want to replicate figure four in Pontusson and Kwon (2010) with different data or, I guess, create the graph in 16:10 https://www.youtube.com/watch?v=RyqTeDxklfk (Stata Time Series Tutorial: The Rolling Regression). The plan is to use a rolling regression with 10-year windows and Prais-Winsten estimates; panel corrected errors and first order autoregressive corrections.

My variables are: id, idn, year (time), uegen (my dependent variable), leftcum (my independent variable), and controls. id=countries (Austria, Denmark, Sweden etc.), year=from 1960 to 2019 (although missing data roughly before and after 1980 and 2011 respectively), uegen=index of unemployment benefits, leftcum=cummulative years of left government rule (so restarting for each country and rising over consecutive years). Unfortunately, It's not my data so won't be able to share it.

I've so far identified the commands: "rolling _b _se, window(10): prais uegen leftcum", generate upper = _b_leftcum_ + 1.96*_se_leftcum, and generate lower = _b_ leftcum - 1.96*se_leftcum. However, I'm not able to plot the figure. Using "two-way (line_b_leftcum) (line upper lower)" from https://www.stata.com/manuals13/tsrolling.pdf (Rolling - Stata) gives the error message "too few variables specified". I don't know how to specify years as the time variable because "tsset" doesn't seem to apply to pooled time series data "repeated time values in sample".

Summary: I'd like to plot 10 year windows of Prais-Winsten estimates with 95% confidence intervals but can't figure out how to create the figure.