Statistical Tests Using R - Assignment-14
Lab Exercise Problems: Statistical Tests Using R
Problem 1: One-Sample t-Test — Battery Life of Smartphones
Problem Statement
A smartphone manufacturer claims that the average battery life of its new smartphone model is 12 hours.
A quality-control engineer tests the battery life of 12 smartphones and obtains the following results (in hours):
11.5, 12.3, 11.8, 12.6, 11.9, 12.1, 12.4, 11.7, 12.2, 12.5, 11.6, 12.0
Tasks
Using R:
- Store the battery life values in a vector.
- Calculate the sample mean and sample standard deviation.
- Formulate the null and alternative hypotheses to test the manufacturer's claim.
- Perform a one-sample t-test at a significance level of 0.05.
-
Obtain the following from the test:
- t-statistic
- Degrees of freedom
- p-value
- 95% confidence interval
- Make an appropriate decision regarding the null hypothesis.
- Interpret whether the sample provides evidence that the average battery life differs from 12 hours.
Statistical Test
One-Sample t-Test
Problem 2: Chi-Square Test — Website Usage Preferences
Problem Statement
A university wants to determine whether students use different types of online learning resources equally often.
A survey of 200 students produced the following preferences:
| Learning Resource | Number of Students |
|---|---|
| Video Tutorials | 70 |
| Online Notes | 45 |
| Interactive Courses | 50 |
| Educational Podcasts | 35 |
Assume that under the null hypothesis, students are expected to prefer all four types of resources equally.
Tasks
Using R:
- Store the observed frequencies in a vector.
- Calculate the expected frequency for each category.
- Formulate the null and alternative hypotheses.
- Calculate the Chi-Square statistic manually.
- Perform a Chi-Square Goodness-of-Fit Test using R.
-
Obtain:
- Chi-Square statistic
- Degrees of freedom
- p-value
- Expected frequencies
- Make a decision at a 5% significance level.
- Interpret whether students have equal preferences for the different learning resources.
Statistical Test
Chi-Square Goodness-of-Fit Test
Problem 3: Wilcoxon Signed-Rank Test — Effect of a New Software Tool on Task Completion Time
Problem Statement
A software company introduces a new development tool that is expected to reduce the time required to complete programming tasks.
The task completion time of 10 programmers is recorded before and after using the new tool.
| Programmer | Before (Minutes) | After (Minutes) |
|---|---|---|
| 1 | 55 | 48 |
| 2 | 62 | 55 |
| 3 | 48 | 45 |
| 4 | 70 | 60 |
| 5 | 65 | 58 |
| 6 | 58 | 52 |
| 7 | 72 | 63 |
| 8 | 50 | 46 |
| 9 | 68 | 59 |
| 10 | 60 | 54 |
Assume that the differences cannot be assumed to follow a normal distribution.
Tasks
Using R:
- Store the completion times before and after using the new tool.
- Calculate the difference between each pair of observations.
- Formulate the null and alternative hypotheses.
- Perform the Wilcoxon Signed-Rank Test.
-
Obtain:
- Test statistic
- p-value
- Make a decision at a 5% significance level.
- Determine whether the new software tool has significantly changed the task completion time.
- Interpret the practical meaning of the result.
Statistical Test
Wilcoxon Signed-Rank Test
Comments
Post a Comment