which will have a Students t distribution with n - 2 degrees of freedom. As usua
ID: 3370111 • Letter: W
Question
which will have a Students t distribution with n - 2 degrees of freedom. As usual, n denotes the sample size, which in the case of the iris data is n-150. Remember, you can compute the sample correlation of two vectors in R using the cor command. Answer the following: (Hint: You might try using the R function cor.test to double-check the answers you get, but you may not use it as the R commands that are asked for below.) (a) Say you hypothesize that irises with wide petals will also have skinny sepals, and skinny petals will coincide with wide sepals (X - iris$Petal.Width and Y - iris$Sepal.Width) What is the alternative hypothesis here for corr(X, Y)? -2 (b) For a significance level of ?-0.05 what is the critical value for the t statistic? Give the R command (one line) for computing this. What does it return? (c) What is the value for the t statistic above? (d) Give the R command (one line) for computing the p-value. What value does it return? (e) Now say you hypothesize that longer petals will be wider and shorter petals will be skinnier. What is the alternative hypothesis in terms of petal width and length? (X- irisSPetal·Width, and Y = irisSPetal.Length) (f) Repeat steps (b), (c), and (d) for this hypothesisExplanation / Answer
>#(a) Alternative Hypothesis,
Ha : r is not equal to 0.
>#(b)critical value of test statistic(R-command)
R-code :
> abs(qt(.025,148))
output:
[1] 1.976122
>#(c) value of t-test statistic for above problem
t = -4.7865
>#(d) since, the test is two-tailed test, then p-value for this test will be ;
R-code:
> 2*pt(-4.7865,148)
output:
[1] 4.072537e-06
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.