शुरू करेंमुफ़्त में शुरू करें

Visualizing goodness of fit

The chi-square goodness of fit test compares proportions of each level of a categorical variable to hypothesized values. Before running such a test, it can be helpful to visually compare the distribution in the sample to the hypothesized distribution.

Recall the vendor incoterms in the late_shipments dataset. Let's hypothesize that the four values occur with these frequencies in the population of shipments.

  • EXW: 0.75
  • CIP: 0.05
  • DDP: 0.1
  • FCA: 0.1

late_shipments is available; tibble, dplyr, ggplot2, and infer are loaded.

यह अभ्यास पाठ्यक्रम का हिस्सा है

Hypothesis Testing in R

पाठ्यक्रम देखें

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Using late_shipments, count the vendor incoterms
vendor_inco_term_counts <- ___


# Get the number of rows in the whole sample
n_total <- ___

hypothesized <- tribble(
  ~ vendor_inco_term, ~ prop,
  "EXW", 0.75,
  "CIP", 0.05,
  "DDP", 0.1,
  "FCA", 0.1
) %>%
  # Add a column of hypothesized counts for the incoterms
  ___

# See the results
hypothesized
कोड संपादित करें और चलाएँ