Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
504 B
10
Indexable
Never
# Observed frequencies
x <- c(20, 30, 92, 105)

# Expected probabilities
ps <- c(1/16, 3/16, 5/16, 7/16)

# Perform the chi-squared test
test <- chisq.test(x, p = ps)

# Print the results
print(test)

# Report the p-value
cat("The p-value is:", test$p.value, "\n")

# Decision at the 0.025 significance level
if (test$p.value < 0.025) {
  cat("We reject the null hypothesis at the 0.025 significance level.\n")
} else {
  cat("We fail to reject the null hypothesis at the 0.025 significance level.\n")
}
Leave a Comment