Question

I need R code that will run this simulation. Using temperature in Chicago data, test if...

I need R code that will run this simulation.

  1. Using temperature in Chicago data, test if the population variance of the temperature is σ2 = 450 at α = 0.1 based on simulation. Do not assume any parametric model. Estimate the 90% confidence interval for σ2 based on the simulation.

X=c(55.0, 38.4, 25.2, 79.3, 60.0, 53.9, 49.1, 50.9, 70.2, 73.7, 73.5, 69.6, 47.2, 77.9, -3.4,

   65.5, 58.8, 33.1, 22.5, 79.5, 49.6, 60.0, 43.5, 14.5, 40.7)

Homework Answers

Answer #1

Hi,

Please find the R code for the  90% confidence interval for σ2 based on the simulation:

X <- c(55.0, 38.4, 25.2, 79.3, 60.0, 53.9, 49.1, 50.9, 70.2, 73.7, 73.5, 69.6, 47.2, 77.9, -3.4,65.5, 58.8, 33.1, 22.5, 79.5, 49.6, 60.0, 43.5, 14.5, 40.7)

var.interval <- function(data, conf.level = 0.90) {
df = length(data) - 1
chilower = qchisq((1 - conf.level)/2, df)
chiupper = qchisq((1 - conf.level)/2, df, lower.tail = FALSE)
v = var(data)
c(df * v/chiupper, df * v/chilower)
}
var.interval(X)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions