GithubHelp home page GithubHelp logo

phycomlab / modmarg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anniejw6/modmarg

0.0 0.0 0.0 367 KB

Calculating Marginal Effects and Levels with Errors Using the Delta Method

Home Page: https://cran.r-project.org/web/packages/modmarg/index.html

R 100.00%

modmarg's Introduction

modmarg

CRAN Version Build Status codecov

Calculate predicted levels and marginal effects using the delta method to calculate standard errors. This is an R-based version of Stata's 'margins' command.

Features:

  • Calculate predictive levels and margins for glm and ivreg objects (more models to be added - PRs welcome) using closed-form derivatives

  • Add custom variance-covariance matrices to all calculations to add, e.g., clustered or robust standard errors (for more information on replicating Stata analyses, see here)

  • Frequency weights are incorporated into margins and effects

Usage

To install this package from CRAN, please run

install.packages('modmarg')

To install the development version of this package, please run

devtools::install_github('anniejw6/modmarg', build_vignettes = TRUE)

Here is an example of estimating predicted levels and effects using the iris dataset:

data(iris)

mod <- glm(Sepal.Length ~ Sepal.Width + Species, 
           data = iris, family = 'gaussian')
           
# Predicted Levels
modmarg::marg(mod, var_interest = 'Species', type = 'levels')

# Predicted Effects
modmarg::marg(mod, var_interest = 'Species', type = 'effects')

There are two vignettes included:

vignette('usage', package = 'modmarg')
vignette('delta-method', package = 'modmarg')

More Reading on the Delta Method

modmarg's People

Contributors

anniejw6 avatar nathanielolin avatar akgold 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.