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:

  1. Store the battery life values in a vector.
  2. Calculate the sample mean and sample standard deviation.
  3. Formulate the null and alternative hypotheses to test the manufacturer's claim.
  4. Perform a one-sample t-test at a significance level of 0.05.
  5. Obtain the following from the test:
    • t-statistic
    • Degrees of freedom
    • p-value
    • 95% confidence interval
  6. Make an appropriate decision regarding the null hypothesis.
  7. 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 ResourceNumber of Students
Video Tutorials70
Online Notes45
Interactive Courses50
Educational Podcasts35

Assume that under the null hypothesis, students are expected to prefer all four types of resources equally.

Tasks

Using R:

  1. Store the observed frequencies in a vector.
  2. Calculate the expected frequency for each category.
  3. Formulate the null and alternative hypotheses.
  4. Calculate the Chi-Square statistic manually.
  5. Perform a Chi-Square Goodness-of-Fit Test using R.
  6. Obtain:
    • Chi-Square statistic
    • Degrees of freedom
    • p-value
    • Expected frequencies
  7. Make a decision at a 5% significance level.
  8. 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.

ProgrammerBefore (Minutes)After (Minutes)
15548
26255
34845
47060
56558
65852
77263
85046
96859
106054

Assume that the differences cannot be assumed to follow a normal distribution.

Tasks

Using R:

  1. Store the completion times before and after using the new tool.
  2. Calculate the difference between each pair of observations.
  3. Formulate the null and alternative hypotheses.
  4. Perform the Wilcoxon Signed-Rank Test.
  5. Obtain:
    • Test statistic
    • p-value
  6. Make a decision at a 5% significance level.
  7. Determine whether the new software tool has significantly changed the task completion time.
  8. Interpret the practical meaning of the result.

Statistical Test

Wilcoxon Signed-Rank Test

Comments

Popular posts from this blog

Statistical Methods Lab ( R Language) PCCBL308 Semester 3 KTU BTech CB and CU 2024 Scheme - Dr Binu V P

Programs in R - using control statements - Assignment 2

Programs to try using Functions in R - Assignment 3