Giter VIP home page Giter VIP logo

intame's Introduction

R package intame: Interval-based Marginal Effects

License CRAN Status Badge CRAN Downloads

Tame your model output with INTerval-bAsed Marginal Effects.

Installation of the package

Install the development version from GitHub (using devtools):

devtools::install_github("bodoburger/intame")

Example

library(intame)
library(nnet)
set.seed(4219)
n = 200
x = runif(n, min = 0, max = 1)
x1 = runif(n, min=0, max=1) + .5*x
x2 = runif(n, min=0, max=1) + .5*x
y2 = function(x) -4 * cos(4*pi*x) * x + 4
y = 4*x1 + y2(x2) + rnorm(n, 0, .5)
df = data.frame(y, x1, x2)
nnet.mod = nnet(y ~ ., df, size = 20, linout = TRUE,
  decay = 0.0001, maxit = 1000, trace = FALSE)
AME.x1 = intame(nnet.mod, df, "x1")
AME.x1
## [0.007, 1.413) 
##       4.054118
plot(AME.x1)

AME.x2 = intame(nnet.mod, df, "x2")
AME.x2
## [0.064, 0.237) [0.237, 0.516) [0.516, 0.736) [0.736, 1.027) [1.027, 1.255) 
##       11.69899      -12.78246       25.51410      -27.39529       43.89440 
## [1.255, 1.446] 
##      -52.06151
plot(AME.x2)

Documentation

See Rmarkdown files.

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.