Skip to content

Instantly share code, notes, and snippets.

@mbusigin
Created March 8, 2015 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbusigin/bc24d36c718771b82803 to your computer and use it in GitHub Desktop.
Save mbusigin/bc24d36c718771b82803 to your computer and use it in GitHub Desktop.
plotNeoclassicalGrowth = function()
{
if ( exists("GDP") == FALSE ) { getSymbols("GDP", src="FRED") }
if ( exists("GDPC96") == FALSE ) { getSymbols("GDPC96", src="FRED") }
if ( exists("CLF16OV") == FALSE ) { getSymbols("CLF16OV", src="FRED") }
if ( exists("GPDI") == FALSE ) { getSymbols("GPDI", src="FRED") }
if ( exists("COFC") == FALSE ) { getSymbols("COFC", src="FRED") }
a = na.omit(merge(Delt(CLF16OV, k=12), (GPDI-COFC)/GDP, Delt(GDPC96, k=4) - Delt(CLF16OV, k=12) - ((GPDI-COFC)/CPIAUCSL)/GDP)) * 100
z = a
names(a) = c("L", "K", "A")
a = na.locf(cbind(USRECD, z))
a = a[ .index(a) %in% .index(z) ]
par(oma=c(0,0,0,0))
par(xaxt="n", yaxt="n")
barplot(a$USRECD, border="grey", col="grey")
par(new=T, xaxt="s", yaxt="s")
barplot(z, col=c("blue", "green", "red"))
legend("topright", c("L(abour)", "K(apital)", "Productivity (A)ugmentation"), col=c("blue","green", "red"), pch=15, lty=0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment