How do I do this in R Studio
1. You are testing a hypothesis Ho: μ = 10 against Ha: μ < 10 based on a SRS of 20 observations from a Normal population. The data give sample mean of 8 and a sample standard deviation of 4. Find the value of t. (use correct formula, plug numerical values into formula, crunch numbers using R, report value of t)
2. What is the area to the left of the t value obtained in question 1?
3. Use R to compare the p-value obtained in question 2 to a significance level of 0.05 (hint: Ask R if one value is greater than (>) the other. The answer should be TRUE or FALSE.).
The R code and its output are given below
#### Part
(1)
mu=10
n=20 # sample
size
xbar=8 #sample
mean
s=4 # sample standrad
deviation
t=(xbar-mu)/(s/sqrt(n));t
##
value of test statistic
## [1] -2.236068
#### Part
(2)
##The
area to the left of the t value is p-value
p_value=pt(t,n-1);p_value
## [1] 0.01877027 # P-value
#### Part
(3)
print(p_value<0.05)
## [1] TRUE
## Since p-value is less than level of significance so we would fail to reject the null hypothesis at \alpha=0.05
Get Answers For Free
Most questions answered within 1 hours.