Statistic Assignment
- Country :
Australia
APPENDIX
#Question 1
# calculate the probability that more than 5 resident loads arrive in the next 5 minutes
lambda <- 50 # Average rate
time_interval <- 0.0833 # 5 minutes in hours
# Calculate the sum of probabilities for k = 0 to 5
prob_sum <- sum(dpois(0:5, lambda * time_interval))
# Probability of more than 5 arrivals
prob_more_than_5 <- 1 - prob_sum
prob_more_than_5
# Question 2
# calculate the confidence interval
# Given values
sample_size <- 130
bamboo_loads <- 18
confidence_level <- 0.95
# Calculate the sample proportion
sample_proportion <- bamboo_loads / sample_size
# Calculate the standard error
standard_error <- sqrt((sample_proportion * (1 - sample_proportion)) / sample_size)
# Calculate the critical value for the given confidence level
critical_value <- qnorm((1 + confidence_level) / 2)
# Calculate the margin of error
margin_of_error <- critical_value * standard_error
# Calculate the confidence interval
lower_bound <- sample_proportion - margin_of_error
upper_bound <- sample_proportion + margin_of_error
# Print the confidence interval
cat("95% Confidence Interval:", lower_bound, "to", upper_bound)
# Question 3
# hi-squared test for variance
# Given data
data <- c(63.9, 78.5, 58.1, 109.4, 87.2, 76.3, 88.5, 66.4, 85.8, 102.1, 71.9, 89.9, 86.7, 68.3, 93.5)
# Degrees of freedom is the sample size minus 1
df <- length(data) - 1
# Calculate the sample variance
sample_variance <- var(data)
# Null hypothesis: Variance = 100
null_variance <- 100
# Calculate the test statistic
test_statistic <- (df * sample_variance) / null_variance
# Calculate the critical value for the Chi-squared distribution
alpha <- 0.05
critical_value <- qchisq(1 - alpha, df)
# Compare the test statistic with the critical value
if (test_statistic > critical_value) {
cat("Reject the null hypothesis. Variance is greater than 100.")
} else {
cat("Fail to reject the null hypothesis. Variance is not significantly different from 100.")
}
# Print test statistic and critical value
cat("nTest statistic:", test_statistic)
cat("nCritical value:", critical_value)
# Question 4
# Given values
sample_size <- 10
sample_mean <- 56
population_mean <- 50
population_stddev <- 10
# Calculate the standard error
standard_error <- population_stddev / sqrt(sample_size)
# Calculate the t-statistic
t_statistic <- (sample_mean - population_mean) / standard_error
# Degrees of freedom
df <- sample_size - 1
# Calculate the critical value for the t-distribution
alpha <- 0.05
critical_value <- qt(1 - alpha, df)
# Compare the t-statistic with the critical value
if (t_statistic > critical_value) {
cat("Reject the null hypothesis. Training leads to an increase in MVPA minutes.")
} else {
cat("Fail to reject the null hypothesis. Training does not lead to a significant increase.")
}
# Print t-statistic and critical value
cat("nT-statistic:", t_statistic)
cat("nCritical value:", critical_value)
# Question 5
# Given values for before installation
mean_before <- 12.0
variance_before <- 100.17
sample_size_before <- 8
# Given values for after installation
mean_after <- 10.2
variance_after <- 96.73
sample_size_after <- 9
# Calculate the pooled standard error
pooled_std_error <- sqrt((variance_before / sample_size_before) + (variance_after / sample_size_after))
# Calculate the t-statistic
t_statistic <- (mean_before - mean_after) / pooled_std_error
# Degrees of freedom
df <- sample_size_before + sample_size_after - 2
# Calculate the critical value for the t-distribution
alpha <- 0.05
critical_value <- qt(1 - alpha, df)
# Compare the t-statistic with the critical value
if (t_statistic > critical_value) {
cat("Reject the null hypothesis. The filtering device has reduced the percentage of impurity significantly.")
} else {
cat("Fail to reject the null hypothesis. There is no significant reduction in the percentage of impurity.")
}
# Print t-statistic and critical value
cat("nT-statistic:", t_statistic)
cat("nCritical value:", critical_value)
# Question 6
# Given values for before policy change
assignments_before <- 250
not_turned_in_before <- 42
# Given values for after policy change
assignments_after <- 210
not_turned_in_after <- 15
# Calculate sample proportions
p_hat_before <- not_turned_in_before / assignments_before
p_hat_after <- not_turned_in_after / assignments_after
# Calculate the pooled sample proportion
p_pooled <- (not_turned_in_before + not_turned_in_after) / (assignments_before + assignments_after)
# Calculate the standard error
se <- sqrt(p_pooled * (1 - p_pooled) * ((1 / assignments_before) + (1 / assignments_after)))
# Calculate the test statistic
z_statistic <- (p_hat_before - p_hat_after) / se
# Calculate the p-value
p_value <- 1 - pnorm(z_statistic)
p_value
# Question 7
# Given data
data <- matrix(c(31, 68, 20, 42, 36, 20, 50, 30, 25, 30, 35, 23), nrow = 4, byrow = TRUE)
rownames(data) <- c("scratches", "structure", "hardware", "finish")
colnames(data) <- c("A", "B", "C")
# Perform chi-squared test
chi_square_result <- chisq.test(data)
# Print the p-value
p_value <- chi_square_result$p.value
p_value
# Question 8
# Given parameters
mu_X <- 4
mu_Y <- 8
sigma_X <- sqrt(5)
sigma_Y <- sqrt(9)
rho <- 0.3
y_condition <- 3
x_condition <- 6
# Calculate the conditional mean and variance of X given Y = 3
mu_X_given_Y <- mu_X + rho * (sigma_X / sigma_Y) * (y_condition - mu_Y)
sigma_X_given_Y <- sigma_X * sqrt(1 - rho^2)
# Calculate the z-score
z_score <- (x_condition - mu_X_given_Y) / sigma_X_given_Y
# Calculate the conditional probability
conditional_probability <- pnorm(z_score)
conditional_probability
Are you struggling to keep up with the demands of your academic journey? Don't worry, we've got your back! Exam Question Bank is your trusted partner in achieving academic excellence for all kind of technical and non-technical subjects.
Our comprehensive range of academic services is designed to cater to students at every level. Whether you're a high school student, a college undergraduate, or pursuing advanced studies, we have the expertise and resources to support you.
To connect with expert and ask your query click here Exam Question Bank