Skip to content
/ infer Public
forked from tidymodels/infer

An R package for tidyverse-friendly statistical inference

Notifications You must be signed in to change notification settings

nfultz/infer

 
 

Repository files navigation

Infer


CRAN_Status_Badge Travis-CI Build Status Coverage Status

The objective of this package is to perform statistical inference using an expressive statistical grammar that coheres with the tidyverse design framework.

Installation


To install the current stable version of infer from CRAN:

install.packages("infer")

To install the developmental version of infer, make sure to install remotes first:

install.packages("remotes")
remotes::install_github("andrewpbray/infer")

Examples


These examples assume that mtcars has been overwritten so that the variables cyl, vs, am, gear, and carb are factors.

mtcars <- as.data.frame(mtcars) %>%
  mutate(cyl = factor(cyl),
          vs = factor(vs),
          am = factor(am),
          gear = factor(gear),
          carb = factor(carb))

Hypothesis test for a difference in proportions:

mtcars %>%
  specify(am ~ vs, success = "1") %>%
  hypothesize(null = "independence") %>%
  generate(reps = 100, type = "permute") %>%
  calculate(stat = "diff in props", order = c("1", "0"))

Confidence interval for a difference in means:

mtcars %>%
  specify(mpg ~ am) %>%
  generate(reps = 100, type = "bootstrap") %>%
  calculate(stat = "diff in means", order = c("1", "0"))

About

An R package for tidyverse-friendly statistical inference

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 88.4%
  • R 11.6%