เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Plotting opportunity cost

Again, interest is in whether the treatment and control groups were equally likely to buy a DVD after reading the experimental statements. Here, you'll create a barplot to visualize the difference in proportions between the treatment and control groups.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Foundations of Inference in R

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Using the opportunity dataset, plot group filled by decision.
  • Call geom_bar() to add a bar plot layer, setting the position argument to "fill" to compare relative frequencies. Note that fill should be defined by the decision for each group.

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Plot group, filled by decision
ggplot(opportunity, aes(x = ___, fill = ___)) + 
  # Add a bar layer, with position "fill"
  ___
แก้ไขและรันโค้ด