Coder Social home page Coder Social logo

infer's Introduction

infer R Package


CRAN_Status_Badge Travis-CI Build Status AppVeyor 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. The pkgdown website for this developmental version is at https://infer.netlify.com.

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

To install the cutting edge version of infer (do so at your own risk), make sure to install remotes first.

install.packages("remotes")
remotes::install_github("tidymodels/infer", ref = "develop")

To see the things we are working on with the package as vignettes/Articles, check out the developmental pkgdown site at https://infer-dev.netlify.com.

Contributing


We welcome others helping us make this package as user friendly and efficient as possible. Please review our contributing and conduct guidelines. Of particular interest is helping us to write testthat tests and in building vignettes that show how to (and how NOT to) use the package. By participating in this project you agree to abide by its terms.

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 (using the formula interface y ~ x in specify()):

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 (using the non-formula interface giving both the response and explanatory variables in specify()):

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

Note that the formula and non-formula interfaces work for all implemented inference procedures in infer. Use whatever is more natural for you. If you will be doing modeling using functions like lm() and glm(), we recommend you begin to use the formula y ~ x notation as soon as possible though.

Other examples are available in the package vignettes.

infer's People

Contributors

ismayc avatar andrewpbray avatar echasnovski avatar simonpcouch avatar beanumber avatar rudeboybert avatar richierocks avatar pirategrunt avatar nicksolomon avatar kennethban avatar mine-cetinkaya-rundel avatar jimrothstein avatar corinne-riddell avatar nfultz avatar alexpghayes avatar topepo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.