CS <- SPCS10RSA
k2k <- "2000-01-01:
G <- GDP
summary(lm(apply.quarterly(SP5[k2k],mean)[,1] ~ PAq[k2k] * UCq[k2k] * G[k2k]*CSq[k2k] - UCq[k2k] -G[k2k] - PAq[k2k]*G[k2k] - UCq[k2k]*G[k2k]*CSq[k2k]))
> summary(lm(apply.quarterly(SP5[k2k],mean)[,1] ~ PAq[k2k] * UCq[k2k] * G[k2k]*CSq[k2k] - UCq[k2k] -G[k2k] - PAq[k2k]*G[k2k] - UCq[k2k]*G[k2k]*CSq[k2k]))
Call:
UCq[k2k] * G[k2k] * CSq[k2k] - UCq[k2k] - G[k2k] - PAq[k2k] *
G[k2k] - UCq[k2k] * G[k2k] * CSq[k2k])
Residuals:
Min 1Q Median 3Q Max
-193.182 -33.564 -0.483 37.984 186.693
Coefficients:
Estimate Std. Error t value Pr (> |t|)
(Intercept) -1.080e+03 3.794e+02 -2.846 0.00591 **
PAq[k2k]:UCq[k2k] 7.692e-05 6.148e-06 12.512 < 2e-16 ***
PAq[k2k]:CSq[k2k] -2.019e-04 3.278e-05 -6.160 5.13e-08 ***
PAq[k2k]:UCq[k2k]:G[k2k] -5.157e-09 4.380e-10 -11.776 < 2e-16 ***
PAq[k2k]:UCq[k2k]:CSq[k2k] -1.639e-07 3.181e-08 -5.153 2.59e-06 ***
PAq[k2k]:G[k2k]:CSq[k2k] 2.161e-08 1.608e-09 13.442 < 2e-16 ***
PAq[k2k]:UCq[k2k]:G[k2k]:CSq[k2k] 9.053e-12 1.822e-12 4.968 5.19e-06 ***
---
Residual standard error: 75.55 on 65 degrees of freedom
Multiple R-squared: 0.9713, Adjusted R-squared: 0.9686
F-statistic: 366.6 on 6 and 65 DF, p-value: < 2.2e-16
> my_sp5cs( k2k, 19981.13, 147810,1120,221)
[1] "m_m params ! apply . quarter - UC w/ nominal GDP"
[1] 2725.425
plot(xts(as.numeric(residuals(lm(apply.quarterly(SP5[k2k],mean)[,1] ~ PAq[k2k] * UCq[k2k] * G[k2k]*CSq[k2k] - UCq[k2k] -G[k2k] - PAq[k2k]*G[k2k] - UCq[k2k]*G[k2k]*CSq[k2k]))),seq(as.Date(strsplit(k2k,"::")[[1]][1]),as.Date(strsplit(k2k,"::")[[1]][2]),by="quarters")),type='p')