Question

(R) need a code for R program or solving the below question(please follow the below instruction thoroughly) and please do not copy other answers.

2. Let X1, .. . , Xn be iid. N(?, ?2). A 100(1-a)% confidence interval for ?2 is

0 0
Add a comment Improve this question Transcribed image text
Answer #1

library(smoothmest)
alpha=.1
mu=66
sigma=4
n=12
N=10^4
c=array(dim=1)
z1=qchisq(alpha/2,n-1,lower.tail=T)
z2=qchisq(1-alpha/2,n-1,lower.tail=T)
for(i in 1:N)
{
x=rdoublex(n,66,4)
t=0
for(j in 1:n)
{
t[j]=(x[j]-mean(x))^2
}
z=sum(t)
c[i]=ifelse((sigma^2<z/z2 && sigma^2 >z/z1),1,0)
}
p_hat=mean(c)
p_hat
p_hat+1/sqrt(N)
p_hat-1/sqrt(N)

p_hat is  0.5157 which different from (1-.1)

next programme----

alpha=.05
mu=66
sigma=1
n=10
N=10^4
c=array(dim=1)
z1=qchisq(alpha/2,n-1,lower.tail=T)
z2=qchisq(1-alpha/2,n-1,lower.tail=T)
for(i in 1:N)
{
x=rexp(n,1)
t=0
for(j in 1:n)
{
t[j]=(x[j]-mean(x))^2
}
z=sum(t)
c[i]=ifelse((sigma^2<z/z2 && sigma^2 >z/z1),1,0)
}
p_hat=mean(c)
p_hat
p_hat+1/sqrt(N) (0.7784)
p_hat-1/sqrt(N) (0.7584)

p_hat is  0.7684  .... And the other cases also done by changing the values of n and alpha

Add a comment
Know the answer?
Add Answer to:
(R) need a code for R program or solving the below question(please follow the below instruction...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Solve using R and show R code Instruction: Please submit your R code along with a...

    Solve using R and show R code Instruction: Please submit your R code along with a brief write-up of the solutions. Some of the questions below can be answered with very little or no programming. However, write code that outputs the final answer and dos not ryuira uper calceulatioms. Q.N. 1) The mammals data set in the MASS package records brain size and body size of 62 different mammals a) Fit a regresion model to describe the relation between brain...

  • Please help with the R code! Thanks! Assume that your data consists of x1, . ....

    Please help with the R code! Thanks! Assume that your data consists of x1, . . , strap sample, we sample with replacement of these n points to obtain a set of IID new points Xi,... , X" such tha , Tn, n values. When we generate the boot- for each l. This new dataset, X* , X*, is called a bootstrap sample (a) (1 pt) Show that the bootstrap sample is an IID random sample from Fn, where TI...

  • Use R and need the R code for every question. 3. Write a program to use...

    Use R and need the R code for every question. 3. Write a program to use Newton's Method to find the minimum of f(x1,x2)--log(1-ㄨㄧ-x2)-log(x1)-log(T2) Use starting value (0.1,0.1) (a) give the value of z1, 2 where the minimum occurs (b) give the minimum function value, f(xi, 2) (c) give the value of the tolerance level you use (d) give the number of iterations to convergence

  • 2-3. Let ?>0 and ?? R. Let X1,X2, distribution with probability density function , Xn be...

    2-3. Let ?>0 and ?? R. Let X1,X2, distribution with probability density function , Xn be a random sample from the zero otherwise suppose ? is known. ( Homework #8 ): W-X-5 has an Exponential ( 2. Recall --)-Gamma ( -1,0--) distribution. a) Find a sufficient statistic Y-u(X1, X2, , Xn) for ? b) Suggest a confidence interval for ? with (1-?) 100% confidence level. "Flint": Use ?(X,-8) ? w, c) Suppose n-4, ?-2, and X1-215, X2-2.55, X3-210, X4-2.20. i-1...

  • Let X1, ... ,X, be a sample of iid N(0,0) random variables with © = R....

    Let X1, ... ,X, be a sample of iid N(0,0) random variables with © = R. a) Show that T = - X-1 Xş is a pivotal quantity. d) Determine an exact (1 – a) x 100% confidence interval for SD(X) = V0 based on T.

  • Solving these useing R program using pbinom() for Statistics Please show the code you used and...

    Solving these useing R program using pbinom() for Statistics Please show the code you used and the answer A manufacturer of ceramic blades estimates that 1.3% of all blades produced are too brittle to use. Suppose we take a random sample of 100 blades and test them for brittleness. We want to find the probability that at least 4 blades will be too brittle to use.

  • this us python plz follow the instructions while u solving I need the code and sane...

    this us python plz follow the instructions while u solving I need the code and sane output QUESTION 1 Write a program that performs the following: 1) request a sentence (at least two words with no punctuation marks) input by the user 2) display the first word 3) display the last letter of the first word 4) display the last word 5) display the first letter of the last word input text can be any content just make sure to...

  • iid 20. Let X1, ...,Xn - Exp(a), the exponential distribution with failure rate 2. We showed...

    iid 20. Let X1, ...,Xn - Exp(a), the exponential distribution with failure rate 2. We showed in Sections 7.2 and 7.3 that â= 1/X is both the MME and the MLE of 2, and that its asymp- totic distribution is given by vn (Å - 1) PW~N (0,22) (8.53) Use the normal distribution in (8.53) to obtain, via a variance stabilizing transformation, an approximate 100(1 – a)% confidence interval for a.

  • 3. Let X1, X2,... , Xn be i.i.dExp(0) NOTE: We have previously found that θMLE X (a) Assuming a l...

    3. Let X1, X2,... , Xn be i.i.dExp(0) NOTE: We have previously found that θMLE X (a) Assuming a large n' derive an approximate 100(1-a)% L for θ that is based on the MLE (b) Now use the pivot Xi ~ χ n to derive an exact 100(1-a)% C.1, for θ. (c) Data was collected on the service time (in minutes) of 100 customers in a bank teller The average service time was 4.382 minutes. Based on the histogram of...

  • Someone plz plz help with this Statistics Intro to R programming question!!! Here are the examples and follow by my question!! Thank you so much!! I appreciate it !!!!My question!!!! Question T...

    Someone plz plz help with this Statistics Intro to R programming question!!! Here are the examples and follow by my question!! Thank you so much!! I appreciate it !!!!My question!!!! Question Type 1: If possible, calculate the 90% confidence intervals for the temperature it takes for crickets to chirp 15 chirps per second. Code (you must copy and paste your code like below in blue color): # Reading in the data Crickets-read.table(C:/Desktop/CricketChirpsvsTemperature.csv', header TRUE, #View Data View Crickets) #Data analysis...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT