Untitled
unknown
plain_text
2 years ago
504 B
12
Indexable
# 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") }
Editor is loading...
Leave a Comment