Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use R language rstudio Answer Q3 Q4 and Q5 3. Where x1,x2, ,Fn s a sample from a normal distribution with unknown mean and unknown
use R language rstudio Answer Q3 Q4 and Q5
3. Where x1,x2, ,Fn s a sample from a normal distribution with unknown mean and unknown variance 2, the level 100(1-a)% confidence interval for is given by where and s are the sample mean and sample standard deviation of the data, and t1-a/2,- cuts off an area 1 - a/2 to its left under the t curve with n -1 degrees of freedom. Write a function which has two arguments, a vector of data x, and alpha, which should have a default value of .05. The function should return a vector of length 2 which contains the endpoints of the confidence interval. The percentiles of the t-distrubtion can be calculated as follows. Suppose that you want the 97.5'th percentile of the t-distribution with 23 degrees of freedom. This can be calculated in R as qt.975,23) ## [1] 2.068658 Test your function by calculating the 99% confidence interval using the following data set.seed(87612345) data-rnorm (25,mean-4.5,sd-.75) You can check your calculation using t.test (data,conf.level-.99) ## One Sample t-test ##data: data ## t 29.832, df 24, p-valueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started