Question

In: Statistics and Probability

Use R to load in the file “data.csv”. Assume that this is a random sample from...

Use R to load in the file “data.csv”. Assume that this is a random sample from some population with mean µ and variance σ 2 .

(a) Plot a histogram of the data.

(b) Compute a 95% confidence interval for the population mean µ using the formula

X ± (S/√ n)tn−1,.975.

(Hint: tn−1,.975 can be computed with qt(.975,df=n-1))

(c) Compute a p-value for the hypothesis H0 : µ = 5 versus HA : µ > 5, based on the test statistic T = X−5 S/√ n .

(Hint: The p-value can be computed using 1-pt(T,df=n-1))

(d) Based on the p-value, do we reject the null hypothesis at α = .01?

(e) What is the smallest significance level α for which we would reject the null?

Data set:

x
1 4.698166
2 4.447565
3 6.841008
4 7.013583
5 3.129358
6 5.147627
7 2.549057
8 4.061032
9 2.482377
10 6.200452
11 3.017356
12 3.54399
13 5.02652
14 5.941181
15 7.012088
16 1.780168
17 4.338341
18 8.932189
19 8.437784
20 8.858227
21 4.750132
22 9.313738
23 4.09576
24 2.746881
25 3.80401
26 9.34906
27 5.87805
28 7.306379
29 7.147015
30 4.489627
31 5.048496
32 3.97515
33 5.325467
34 8.177696
35 6.422605
36 7.81162
37 9.849941
38 9.936086
39 8.045554
40 4.141212
41 5.19843
42 6.439768
43 5.067979
44 3.790223
45 8.642296
46 10.72038
47 5.450084
48 4.960262
49 3.355154
50 4.35933

Solutions

Expert Solution

Sol:

> library(readr)
> Data <- read_delim("C:/Users/M1045151/Downloads/Data.csv", + ";", escape_double = FALSE, trim_ws = TRUE)

After importing

T get histogram in R

hist(Data$x)

From histogram we observe that x follows normal distribution

SolutionB:

Rcode:

n <- 50
qt(.975,df=50-1)

mean(Data$x)
sd(Data$x)

tc=2.009575

xbar=sample mean=5.781129

sample sd=s=

95% confidence interval for mean

xbar-tc8s/sqrt(50),xbar+tc*s/sqrt(n)

5.781129-2.009575*2.246647/sqrt(50),5.781129+2.009575*2.246647/sqrt(50)

5.142639,6.419619

95% lower limit:5.142639

95% upper limit=6.419619

SIMPLE RCODE TO GET ABOVE ANSWER:

t.test(Data$x)

Output:

One Sample t-test

data: Data$x
t = 18.195, df = 49, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
5.142639 6.419619
sample estimates:
mean of x
5.781129

95 percent confidence interval:
5.142639 6.419619

Solutionc:

Rcode:

t.test(Data$x,mu=5,alternative = "greater")

output:

One Sample t-test

data: Data$x
t = 2.4585, df = 49, p-value = 0.008766
alternative hypothesis: true mean is greater than 5
98 percent confidence interval:
5.110772 Inf
sample estimates:
mean of x
5.781129

p=0.008766

(d) Based on the p-value, do we reject the null hypothesis at α = .01?

p=0.008766

alpha=0.01

p>0.01

Fail to reject Ho.

(e) What is the smallest significance level α for which we would reject the null?

smallest level of alpha=10%=0.10

because as p=0.008766

p<alpha

reject Ho.

ANSWER:

10%

RSCREENSHOT:


Related Solutions

R Simulation: For n = 1000, simulate a random sample of size n from N(0,1). Use...
R Simulation: For n = 1000, simulate a random sample of size n from N(0,1). Use the generated data to give an approximation to the critical values when α = 0.01,0.05,0.1, and compare them with the theoretical values zα/2. Repeat with n = 10,000 to get a better approximation. Please use Commands quantile( ) or qnorm( ) or both.
Using R Studio/R programming... Usually, we will use a random sample to estimate the statistics of...
Using R Studio/R programming... Usually, we will use a random sample to estimate the statistics of the underlying population. If we assume a given population is a standard normal distribution and we want to estimate its mean, which is the better technique to estimate that mean from a sample: Use the mean of one random sample of size 500 Use the mean of 300 random samples of size 10 Run your own experiment and use your results as a supporting...
Assume that the sample is a simple random sample obtained from a normally distributed population of...
Assume that the sample is a simple random sample obtained from a normally distributed population of IQ scores of statistics professors. Use the table below to find the minimum sample size needed to be 99​% confident that the sample standard deviation s is within 1​% of sigma. Is this sample size​ practical? sigma To be​ 95% confident that s is within ​1% ​5% ​10% ​20% ​30% ​40% ​50% of the value of sigma​, the sample size n should be at...
Assume that each sample is a simple random sample obtained from a population with a normal...
Assume that each sample is a simple random sample obtained from a population with a normal distribution. a. n= 93 mean=3.90968 s=0.51774 Construct a 99​% confidence interval estimate of the standard deviation of the population from which the sample was obtained. b. n=93 mean=4.09355 s=0.59194 Repeat part​ (a). How do you find values on a chi-square table when the degrees of freedom are a value not commonly found on standard chi-square tables? (In this case, 92)
A simple random sample of 20 customers is taken from a customer information file and the...
A simple random sample of 20 customers is taken from a customer information file and the average age is 27. The sample standard deviation s is found to be 5.                                              (5 marks) Test the hypothesis that the population mean age is less than 29 using the critical value approach and a 0.10 level of significance. Test the hypothesis that the population mean age is different from 30 using the 0.05 level of significance.
A simple random sample of 20 customers is taken from a customer information file and the...
A simple random sample of 20 customers is taken from a customer information file and the average age is 27. The sample standard deviation s is found to be 1.5.                                                 (5 marks) Test the hypothesis that the population mean age is less than 29 using the critical value approach and a 0.10 level of significance. Test the hypothesis that the population mean age is different from 30 using the 0.05 level of significance. .
Load the USArrests sample dataset from the built-in datasets (data(USArrests)) into R using a dataframe (Note:...
Load the USArrests sample dataset from the built-in datasets (data(USArrests)) into R using a dataframe (Note: Row names are states, not numerical values!). Use the kmeans package to perform a clustering of the data with increasing values of k from 2 to 10 - you will need to decide whether or not to center/scale the observations - justify your choice. Plot the within-cluster sum of squares for each value of k - what is the optimal number of clusters? Use...
In order to determine the load capacity of a lift, a random sample of 15lifts are...
In order to determine the load capacity of a lift, a random sample of 15lifts are stress tested and the maximum weight that each life can bear before malfunctioning is recordedas the “Maximum Load”. Suppose thatthe mean of the maximum load is1279 pounds and the standard deviation of the maximum loadis 123 pounds. a.Verify that the conditions for constructing confidence intervals for the mean are met. b.Compute and interpret a 99% confidence interval for the mean of the maximum weight...
8. Assume that a sample random sample has been selected and test the given claim. Use...
8. Assume that a sample random sample has been selected and test the given claim. Use the​ P-value method for testing hypotheses. Identify the null and alternative​ hypotheses, test​ statistic, P-value, and state the final conclusion that addresses the original claim. The ages of actresses when they won an acting award is summarized by the statistics nequals76​, xequals35.5 ​years, and sequals11.6 years. Use a 0.05 significance level to test the claim that the mean age of actresses when they win...
8. Assume that a sample random sample has been selected and test the given claim. Use...
8. Assume that a sample random sample has been selected and test the given claim. Use the​ P-value method for testing hypotheses. Identify the null and alternative​ hypotheses, test​ statistic, P-value, and state the final conclusion that addresses the original claim. The ages of actresses when they won an acting award is summarized by the statistics nequals76​, xequals35.5 ​years, and sequals11.6 years. Use a 0.05 significance level to test the claim that the mean age of actresses when they win...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT