# MinutePlot validation -- Time-series slope over a window (generated series)
# Install once: nothing -- this script uses base R only

# Versions (compare against those stated on this page):
cat(R.version.string, "\n")

# Load data:
d <- read.csv("series_slope.csv")   # same folder as script (x, y; fixed seed)
w <- subset(d, x >= 10 & x <= 30)       # the window shown on the page

# Analysis (one print per table shown on the page, in page order):
fit <- lm(y ~ x, data = w)
print(summary(fit))                                     # slope, intercept, SE, p, R2 over the window
