This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
survey <- read.csv("http://www.ditraglia.com/econ103/old_survey.csv") | |
survey <- survey[,c("handedness", "height", "handspan")] | |
head(survey) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
survey <- read.csv("http://www.ditraglia.com/econ103/old_survey.csv") | |
survey <- survey[,1:6] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1.1 Expressions | |
1 + 1 | |
"Arr, matey!" | |
6*7 | |
#1.2 Logical Values | |
3 < 4 | |
2 + 2 == 5 | |
#1.3 Variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x <- 5 | |
x == 5 | |
foo <- 3 | |
bar <- 5 | |
foo.bar <- foo + bar | |
foo.bar2 <- 2 * foo.bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(Quandl) | |
p <- 100 * Quandl('FRED/GDPDEF', collapse = 'quarterly', start_date = '1960-01-01', end_date = '2012-01-01', type = 'ts', transformation = 'rdiff') | |
#Michigan Inflation Expectations aren't in Quandl yet | |
library(quantmod) | |
getSymbols("MICH",src="FRED") | |
#Median expected price change next 12 months, Survey of Consumers. | |
#Convert to ts object | |
MICH.start <- as.numeric(format.Date(start(MICH), '%Y')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This script carries out a simulation study similar to that in Section 2 of ``Posterior Predictive Evidence on US Inflation...'' by Basturk et al (2012), exploring the effects of trend mis-specification on the estimate of the persistence of the inflation parameter. | |
#Library to implement Bai and Perron (2003) | |
library(strucchange) | |
set.seed(4513) | |
g <- 0.5 #Inflation persistence | |
N.sims <- 250 #Simulation repetitions |
NewerOlder