---
title: "Day 22"
subtitle: "Standardized Effect Size"
format: html
editor: visual
---

# Exploring Effect Sizes Activity

## Part 1: How do we create effect sizes?

An effect size is simply a re-scaling of a distance. You have done it before in math classes and even in everyday life. Consider this:

> You and your friend are racing your pet turtles to see who can get farther in a minute. Your turtles take turns running from the same starting line and then stop after a minute. You mark with an X where they each ended up. Then you find the distance between each of your Xs.

Let's say you simply want to know the distance in (inches) between the two places. You might simply measure the distance in inches to start with or subtract to find the difference in your total distance. See the image below.

![](images/EPSY%205262.jpg)

We know that the turtles were 15 inches apart. But suppose we were interested in a different scale. Instead of inches we want to know how many feet apart they are.

1.  How would you determine how many feet apart they were?
2.  Next you and your friend redo the turtle race. This time your turtle travels 32 inches and your friend's turtle 40 inches. How would you determine how many yards apart they were?

The system you are describing in Question #1 and #2 is how to re-scale distances. This is exactly the idea behind effect sizes, however with effect sizes the scale we want to use, instead of something like inches or feet, is the *standard deviation*.

\
\

## Part 2: Why do we create effect sizes?

Let's think about the following: Why would we want to scale our difference by the standard deviation?

3.  What is the standard deviation?
4.  Why is the standard deviation a useful summary measure?

Suppose you are choosing between two EPSY 5262 instructors. You want to choose the one where students on average get the higher grade. The file grades.csv has grades (*grades* variable) for 50 students in each instructors class (*instructor* variable). Open the data file grades.csv and find the average for each instructor.

5.  Based on only the means, which instructor would you choose?

-   To get an effect size we will need the `{MBESS}` package. Install and load the `{MBESS}` package if you haven't done this yet.

-   Next calculate the effect size for the difference in means between the two instructors using the code chunk below.

```{r}
# Compute Cohen's d
smd(
  Mean.1 = XX, s.1 = XX, n.1 = XX, 
  Mean.2 = XX, s.2 = XX, n.2 = XX  
  )
```

6.  Is this a small, medium, or large effect size?
7.  Based on this effect size which instructor are you going to choose?

\
\

## Part 3: Accounting for Uncertainty in Effect Size Estimates

We know that our estimates have uncertainty and we can take it into account using a confidence interval. Let's calculate a confidence interval for Cohen's d.

Alter the following code chunk to find the 90% confidence interval for out estimate from Question #6.

```{r}
ci.smd(
  smd = XX,       #Cohen's d
  n.1 = XX,       #Sample size for group 1
  n.2 = XX,       #Sample size for group 2
  conf.level= XX  #Confidence Level
)
```

8.  Interpret your confidence interval.
