Welcome to the course!

R'da Sayısal Veriler için Çıkarım

Mine Cetinkaya-Rundel

Associate Professor of the Practice, Duke University

Rent in Manhattan

On a given day, twenty 1 BR apartments were randomly selected on Craigslist Manhattan from apartments listed as "by owner" (as opposed to by a rental agency).

Is the mean or the median a better measure of typical rent in Manhattan?

chp1-vid1-manhattan-rents

R'da Sayısal Veriler için Çıkarım

Bootstrapping techniques

  • Assume the data is representative
  • Pulling oneself up by one's bootstraps
R'da Sayısal Veriler için Çıkarım

Observed sample

sample median = $2,350

chp1-vid1-bootsamp-bootpop

R'da Sayısal Veriler için Çıkarım

Bootstrap population

chp1-vid1-bootsamp-bootpop

R'da Sayısal Veriler için Çıkarım

Bootstrapping scheme

  1. Take a bootstrap sample - a random sample taken with replacement from the original sample, of the same size as the original sample.

  2. Calculate the bootstrap statistic - a statistic such as mean, median, proportion, etc. computed on the bootstrap samples.

  3. Repeat steps (1) and (2) many times to create a bootstrap distribution - a distribution of bootstrap statistics.

R'da Sayısal Veriler için Çıkarım

Bootstrapping scheme, in R

library(infer)

___ %>%                               # start with data frame
  specify(response = ___) %>%         # specify the variable of interest
R'da Sayısal Veriler için Çıkarım

Bootstrappping scheme, in R

library(infer)

___ %>%                               # start with data frame
  specify(response = ___) %>%         # specify the variable of interest
  generate(reps = ___, type = "bootstrap") %>%  # generate bootstrap samples
R'da Sayısal Veriler için Çıkarım

Bootstrapping scheme, in R

library(infer)

___ %>%                               # start with data frame
  specify(response = ___) %>%         # specify the variable of interest
  generate(reps = ___, type = "bootstrap") %>%  # generate bootstrap samples
  calculate(stat = "___")             # calculate bootstrap statistic
R'da Sayısal Veriler için Çıkarım

Constructing the bootstrap interval

library(infer)

___ %>%                               # start with data frame
  specify(response = ___) %>%         # specify the variable of interest
  generate(reps = ___, type = "bootstrap") %>%  # generate bootstrap samples
  calculate(stat = "___")             # calculate bootstrap statistic

chp1-vid1-boot-dist-noaxes

R'da Sayısal Veriler için Çıkarım

Constructing the bootstrap interval

library(infer)

___ %>%                               # start with data frame
  specify(response = ___) %>%         # specify the variable of interest
  generate(reps = ___, type = "bootstrap") %>%  # generate bootstrap samples
  calculate(stat = "___")             # calculate bootstrap statistic

chp1-vid1-boot-dist-noaxes-parantheses

R'da Sayısal Veriler için Çıkarım

Let's practice!

R'da Sayısal Veriler için Çıkarım

Preparing Video For Download...