ch2problem4-rcode

# ch2problem4-rcode - Chapter 2 Confidence Interval...

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

Sheet1 Page 1 # Chapter 2 -- Confidence Interval Problems #BACKGROUND # In order to compute confidence intervals, we can either do the # computations manually (using using the qt() function), or we can use # the confint function. # The qt() function is the quantile function for the t distribution # with a specified degrees of freedom parameter. # Using qt(): qt(.025,21) #[1] -2.079614 # This tells us that P(T <= -2.079614) = 0.025 when T has a t # distribution with 21 degrees of freedom. qt(.95,13) #[1] 1.770933 # Similarly, P(T <= 1.77) = .95 for T with t dist w/ 13df. #To see this on a plot: a=seq(-3,3,length=100) plot(a,dt(a,13),type="l",xlab="y",ylab="f(y)") lines(c(1.77,1.77),c(0,dt(1.770933,13))) text(0,.01,"area of this region = 0.95") text(2.3,.01,"area = 0.05") title("Shows a t dist with 13 df, vertical line at y=1.770933") #_________________________________________________________________ # Using the data from Chapter 1, problem 19, construct a 99% CI for # beta1 and interpret it. See earlier chp1pr19 file to read in the

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.

{[ snackBarMessage ]}

### Page1 / 2

ch2problem4-rcode - Chapter 2 Confidence Interval...

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

View Full Document
Ask a homework question - tutors are online