Dr. Hackney STA Solutions pg 163

Dr. Hackney STA Solutions pg 163 - ional, as R does not...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
10-6 Solutions Manual for Statistical Inference 10 . 17 a. The correlation is . 7781 b. Here is R code (R is available free at http://cran.r-project.org/) to bootstrap the data, calculate the standard deviation, and produce the histogram: cor(law) n <- 15 theta <- function(x,law){ cor(law[x,1],law[x,2]) } results <- bootstrap(1:n,1000,theta,law,func=sd) results[2] hist(results[[1]]) The data “law” is in two columns of length 15, “results[2]” contains the standard deviation. The vector “results[[1]]” is the bootstrap sample. The output is V1 V2 V1 1.0000000 0.7781716 V2 0.7781716 1.0000000 $func.thetastar [1] 0.1322881 showing a correlation of . 7781 and a bootstrap standard deviation of . 1323. c. The R code for the parametric bootstrap is mx<-600.6;my<-3.09 sdx<-sqrt(1791.83);sdy<-sqrt(.059) rho<-.7782;b<-rho*sdx/sdy;sdxy<-sqrt(1-rho^2)*sdx rhodata<-rho for (j in 1:1000) { y<-rnorm(15,mean=my,sd=sdy) x<-rnorm(15,mean=mx+b*(y-my),sd=sdxy) rhodata<-c(rhodata,cor(x,y)) } sd(rhodata) hist(rhodata) where we generate the bivariate normal by first generating the marginal then the condid-
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ional, as R does not have a bivariate normal generator. The bootstrap standard deviation is 0 . 1159, smaller than the nonparametric estimate. The histogram looks similar to the nonparametric bootstrap histogram, displaying a skewness left. d. The Delta Method approximation is r ∼ n( ρ, (1-ρ 2 ) 2 /n ) , and the “plug-in” estimate of standard error is p (1-. 7782 2 ) 2 / 15 = . 1018, the smallest so far. Also, the approximate pdf of r will be normal, hence symmetric. e. By the change of variables t = 1 2 log ± 1 + r 1-r ² , dt = 1 1-r 2 , the density of r is 1 √ 2 π (1-r 2 ) exp ³-n 2 ´ 1 2 log ± 1 + r 1-r ²-1 2 log ± 1 + ρ 1-ρ ²µ 2 ! ,-1 ≤ r ≤ 1 . More formally, we could start with the random variable T , normal with mean 1 2 log ¶ 1+ ρ 1-ρ · and variance 1 /n , and make the transformation to R = e 2 T +1 e 2 T-1 and get the same answer....
View Full Document

This note was uploaded on 02/03/2012 for the course STA 1014 taught by Professor Dr.hackney during the Spring '12 term at UNF.

Ask a homework question - tutors are online