Design of Studies (Pt. 1)

Homer White, Georgetown College

In Part 1:

Load Packages

Always remember to make sure the necessary packages are loaded:

require(mosaic)
require(tigerstats)

Observational Studies

Relationship Questions

Really interesting questions in science are about relationships between variables:

  • Usually one variable \( X \) is considered explanatory
  • The other variable \( Y \) is considered a response

The explanatory variable might

  • help explain
  • help predict
  • maybe even cause

the response variable.

Relationship Question

Does smoking cause lung cancer?

  • Explanatory \( X \) is smoke (Yes, No)
  • Response variable \( Y \) is lung cancer (Yes,No)

Relationship Questions

Learn about the attitudes data frame:

data(attitudes)
View(attitudes)
help(attitudes)

Relationship Questions

Who gives the longest sentences on average: math/science majors, humanities majors, social science majors, or pre-professional majors?

  • Explanatory variable \( X \) = major
  • Response variable \( Y \) = sentence

Quick Look (Numerical)

favstats(sentence~major,data=attitudes)
      .group  mean median
1 humanities 25.26     20
2   math.sci 30.49     30
3   pre.prof 25.02     25
4 social.sci 25.49     25

Quick Look (Graph)

plot of chunk majorsent

Observational Study

Definition:

In an observational study researchers simply observe or question the subjects. In particular, they measure the values of the explanatory variable \( X \) and measure the values of the response variable \( Y \), for each subject.

Causation

Causation Questions

One of the most common reasons to study the relationship between two variables is to see if one of them causes the other.

Speeding Causes Tickets

Error in eval(expr, envir, enclos) : 
  could not find function "openplotmat"