hw6.sol

# hw6.sol - Page 1 of 3 Stat209/Ed260 D Rogosa 2/20/09...

This preview shows pages 1–2. Sign up to view the full content.

Stat209/Ed260 D Rogosa 2/20/09 Solutions Assignment 6. Instrumental variable methods, simultaneous equations see also Lab3 exercises ------------------------ Problem 1. Schneider et al Public School choice reprinted paper also available Jstor Institutional Arrangements and the Creation of Social Capital: The Effects of Public School Choice Mark Schneider; Paul Teske; Melissa Marschall; Michael Mintrom; Christine Roch The American Political Science Review > Vol. 91, No. 1 (Mar., 1997), pp. 82-93 Stable URL: http://links.jstor.org/sici?sici=0003-0554%28199703%2991%3A1%3C82%3AIAATCO%3E2.0.CO%3B2-6 Answers in Freedman text p.262 scan of answer page at http://www-stat.stanford.edu/~rag/stat209/08hw6p1sol.pdf ---------------- Problem 2. simulation described in Freedman text bottom p.191-top p.192 > library(MASS) Warning message: package 'MASS' was built under R version 2.2.1 > ?mvrnorm > # Freedman pp191-2, simulate 100 obs make .3 correlation delta epsilon > zeddelteps = mvrnorm(n=100, mu = c(0,0,0), Sigma= + matrix(nrow = 3, ncol = 3, data = c(3,0,0,0,1,.3,0,.3,1), byrow = T), empirical = TRUE) > cor(zeddelteps) [,1] [,2] [,3] [1,] 1.000000e+00 2.661070e-16 -3.463923e-16 [2,] 2.661070e-16 1.000000e+00 3.000000e-01 [3,] -3.463923e-16 3.000000e-01 1.000000e+00 > # could also just take what I get from mvrnorm to get close go up to 400 at least > xsim = .75*zeddelteps[,1] + zeddelteps[,2] # C = .75 set > cor(xsim, zeddelteps[,1]) [1] 0.7924058 > ysim = .5*xsim + zeddelteps[,3] # beta = .5 set > cor(ysim,xsim) [1] 0.7140388 > ols = lm(ysim ~ xsim) > summary(ols) Call: lm(formula = ysim ~ xsim) Residuals: Min 1Q Median 3Q Max -3.8382 -0.4933 0.0961 0.6177 1.8380 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -2.542e-16 9.881e-02 -2.57e-15 1 xsim 6.116e-01 6.058e-02

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 08/20/2011 for the course STATS 209 taught by Professor Rogosa,d during the Winter '09 term at Stanford.

### Page1 / 3

hw6.sol - Page 1 of 3 Stat209/Ed260 D Rogosa 2/20/09...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online