All Projects → anniejw6 → modmarg

anniejw6 / modmarg

Licence: other
Calculating Marginal Effects and Levels with Errors Using the Delta Method

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to modmarg

forestplot
Advanced forest plots in R using grid graphics
Stars: ✭ 29 (+93.33%)
Mutual labels:  cran
cattonum
Encode Categorical Features
Stars: ✭ 31 (+106.67%)
Mutual labels:  cran
ferryd
Fast, safe and reliable transit for the delivery of software updates to users.
Stars: ✭ 43 (+186.67%)
Mutual labels:  delta
tidytree
🚿A Tidy Tool for Phylogenetic Tree Data Manipulation
Stars: ✭ 34 (+126.67%)
Mutual labels:  cran
rchess
♛ Chess package for R
Stars: ✭ 68 (+353.33%)
Mutual labels:  cran
xfun
Miscellaneous R functions
Stars: ✭ 102 (+580%)
Mutual labels:  cran
pbapply
Adding progress bar to '*apply' functions in R
Stars: ✭ 115 (+666.67%)
Mutual labels:  cran
digest
R package to create compact hash digests of R objects
Stars: ✭ 94 (+526.67%)
Mutual labels:  cran
ctv
CRAN Task View Initiative
Stars: ✭ 17 (+13.33%)
Mutual labels:  cran
spacers
🔳 when you need more __space__ for your no-code tools.
Stars: ✭ 211 (+1306.67%)
Mutual labels:  margin
rcppredis
R interface to Redis using the hiredis library
Stars: ✭ 45 (+200%)
Mutual labels:  cran
opendata
CRAN OpenData Task View
Stars: ✭ 192 (+1180%)
Mutual labels:  cran
demography
demography package for R
Stars: ✭ 44 (+193.33%)
Mutual labels:  cran
cran-network-structure
Scripts used for my UseR!2015 presentation on the network structure of CRAN
Stars: ✭ 22 (+46.67%)
Mutual labels:  cran
rcppgsl
Rcpp integration for GNU GSL vectors and matrices
Stars: ✭ 28 (+86.67%)
Mutual labels:  cran
PackageDevelopment
Task View: PackageDevelopment
Stars: ✭ 38 (+153.33%)
Mutual labels:  cran
base
Scripts used to build R 3.3 - 3.6 on Windows (retired)
Stars: ✭ 42 (+180%)
Mutual labels:  cran
GDINA
GDINA
Stars: ✭ 23 (+53.33%)
Mutual labels:  cran
rsoi
Import Climate Indices into R
Stars: ✭ 14 (-6.67%)
Mutual labels:  cran
ctv-finance
CRAN Task View: Empirical Finance
Stars: ✭ 51 (+240%)
Mutual labels:  cran

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].