Answered step by step
Verified Expert Solution
Link Copied!

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 Q5image text in transcribedimage text in transcribed

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-value

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Implementing Ai And Machine Learning For Business Optimization

Authors: Robert K Wiley

1st Edition

B0CPQJW72N, 979-8870675855

More Books

Students also viewed these Databases questions