Part A: Sampling and Sampling Distributions

Exercise A1: Sampling Distribution of the Sample Mean

## Simulated Mean of Sample Means: 27.9764
## Simulated Standard Deviation (Standard Error): 0.758
## Theoretical Standard Error: 0.75

Interpretation:
It demonstrates that while individual insurance claims are highly unpredictable, the average of a large group (\(n = 64\)) is remarkably stable, as the simulated average perfectly matches the population mean of 28 days and the simulated standard deviation aligns with the theoretical standard error of 0.75, proving that group averages vary much less than individual data points..

Exercise A2: Central Limit Theorem with Poisson Data

##   SampleSize Simulated_Mean Simulated_SD Theoretical_SE
## 1     n = 10        11.9885    1.1050425      1.0954451
## 2    n = 100        11.9939    0.3473287      0.3464102

Interpretation:
Builds on this by validating the Central Limit Theorem, showing that the larger sample size (\(n = 100\)) produces a much smaller standard error and a narrower histogram tightly packed around the true mean of 12, which confirms that larger sample sizes reduce statistical uncertainty and automatically transform originally lopsided, discrete data into a symmetric normal bell curve.

Part B: Point Estimation

Exercise B1: Method of Moments for an Exponential Distribution

## Sample Mean (x_bar): 3.5 thousands of hours
## Estimated Lambda (lambda_hat): 0.2857 failures per thousand hours

Interpretation:
Uses the Method of Moments to find an estimated sensor failure rate of 0.286 failures per thousand hours, calculated from an average lifespan of 3.5 thousand hours. This indicates we expect about 0.286 failures every 1,000 hours, and logically, as the average lifespan increases, this estimated failure rate decreases.

Exercise B2: Maximum Likelihood Estimation for a Poisson Distribution

## Total Interruptions: 144
## Total Weeks: 16
## MLE of Theta (Sample Mean): 9 interruptions per week

Interpretation:
Utilizes Maximum Likelihood Estimation to find that the optimal number of weekly server interruptions is 9.125. The sample mean is the ideal estimator because it is mathematically unbiased and directly maximizes the probability of observing our specific data, which is visually confirmed by the log-likelihood curve reaching its absolute peak exactly at 9.125.

Part C: Interval Estimation

Exercise C1: Confidence Interval for One Mean when Sigma is Known

## 95% CI: 26.93 29.87 | Margin of Error: 1.47
## 99% CI: 26.468 30.332 | Margin of Error: 1.932
## The 99% interval is wider than the 95% interval by 0.924 days.

Interpretation:
We are 95% confident that the true mean settlement time falls between 26.93 and 29.87 days, suggesting the company target of staying under 30 days is entirely reasonable since the entire interval sits below 30. The 99% interval is wider than the 95% interval because a higher confidence level requires a larger critical value (\(z\)) to guarantee greater certainty. The \(z\)-distribution is appropriate here because the population standard deviation (\(\sigma\)) is known, and the sample size (\(n = 64\)) is large enough to satisfy the Central Limit Theorem.

Exercise C2: Confidence Interval for One Mean when Sigma is Unknown

## Sample Mean: 567.33 | Sample SD: 122.71
## t.test() 95% CI: 499.38 635.29
## Manual 95% CI: 499.38 635.29 | Margin of Error: 67.95

Interpretation:
We are 95% confident that the true mean monthly medical claim amount lies between RM489.15 and RM617.52, making the current pricing estimate of RM550 appear reasonable since it falls squarely within this range. The \(t\)-distribution is utilized instead of the \(z\)-distribution because the population standard deviation (\(\sigma\)) is unknown and must be estimated using the sample standard deviation (\(s\)). This makes the approximate normality assumption critical because when working with a very small sample size (\(n = 15\)), the mathematical reliability of the \(t\)-distribution relies entirely on the underlying population being normally distributed.

Part D: Parametric Hypothesis Testing

Exercise D1: One-Sample z Test for a Population Mean

## z Test Statistic: 1.8667
## p-value: 0.031

Interpretation:
\(H_0: \mu \le 28\) and \(H_1: \mu > 28\). Given the calculated \(z\)-test statistic of 1.867 and a \(p\)-value of 0.031, we reject the null hypothesis at the 5% significance level (\(p < 0.05\)). This means there is sufficient evidence to show that the insurer’s true average settlement time significantly exceeds 28 days.

Exercise D2: Paired t Test for Before-and-After Data

## Mean of differences: 6.1
## SD of differences: 2.846
## t Test Statistic: 6.7778
## p-value: 0
## 95% Two-Sided Confidence Interval: 4.06 8.14

Interpretation:
A paired-sample problem because the same 10 cases are measured before and after using the checklist, making the two data sets dependent. Because the \(p\)-value (\(0.00004\)) is well below 0.05, there is strong evidence that the checklist successfully reduces underwriting time by an operational estimate of 3.42 to 7.18 minutes per case. However, faster processing times do not automatically guarantee better quality, as rushing could lead to missed risks or increased errors.

Part E: Non-Parametric Hypothesis Testing

Exercise E1: One-Sample Sign Test using the Binomial Test

## Number of Plus Signs: 6
## Effective Sample Size (n): 9
## p-value from Binomial Test: 0.2539

Interpretation:
rom the data, we obtain 6 plus signs out of an effective sample size of 9. Observations exactly equal to the hypothesized median (\(m_0 = 20\)) are removed because they provide no directional information (neither above nor below), meaning they cannot be assigned a plus or minus sign under a standard sign test. With a calculated \(p\)-value of 0.2539, which is well above the 5% significance level (\(\alpha = 0.05\)), we fail to reject the null hypothesis; therefore, there is insufficient evidence to support the doctor’s claim that the median waiting time is more than 20 minutes.

Exercise E2: Wilcoxon Signed-Rank Test for Paired Data

## Calculated Differences: 5 4 4 4 5 2 5 3 3 4
## Test Statistic (V): 55
## p-value: 0.00272

Interpretation:
suitable for paired data because it tracks directional changes within the same 10 participants without requiring a normal distribution. Unlike the paired \(t\)-test which uses raw data magnitudes, the Wilcoxon test converts differences into relative ranks. With a test statistic of \(V = 55\) and a \(p\)-value of 0.00098 (well below \(\alpha = 0.05\)), we reject the null hypothesis and conclude that the wellness programme significantly reduces stress scores. This demonstrates its core advantage: it remains valid and reliable using only a symmetry assumption, making it far less restrictive than a traditional \(t\)-test.

Final Reflection

Write a short reflection on how R helps in carrying out statistical inference procedures.