Questions tagged [marginal-effects]

Marginal effects in regression analysis show how an explained variable changes when a particular explanatory variable changes ceteris paribus.

147 questions
21
votes
4 answers

Is there a way of getting "marginal effects" from a `glmer` object

I am estimating random effects logit model using glmer and I would like to report Marginal Effects for the independent variables. For glm models, package mfx helps compute marginal effects. Is there any package or function for glmer objects? Thanks…
Rfan
  • 722
  • 6
  • 11
12
votes
1 answer

glmer logit - interaction effects on probability scale (replicating `effects` with `predict`)

I am running glmer logit models using the lme4 package. I am interested in various two and three way interaction effects and their interpretations. To simplify, I am only concerned with the fixed effects coefficients. I managed to come up with a…
Erdne Htábrob
  • 819
  • 11
  • 29
8
votes
3 answers

How to run the predicted probabilities (or average marginal effects) for individuals fixed effects in panel data using R?

These are three different ways to run an individual fixed effect method which gives more or less the same results (see below). My main question is how to get predictive probabilities or average marginal effects using the second model (model_plm) or…
Jack
  • 813
  • 4
  • 17
8
votes
3 answers

How to get average marginal effects (AMEs) with standard errors of a multinomial logit model?

I want to get the average marginal effects (AME) of a multinomial logit model with standard errors. For this I've tried different methods, but they haven't led to the goal so far. Best attempt My best attempt was to get the AMEs by hand using mlogit…
jay.sf
  • 60,139
  • 8
  • 53
  • 110
5
votes
2 answers

Replicating the Stata marginlist argument using R margins package?

I am unable to replicate in R a particular use case of the Stata margins command: margins var1, over(var2) I've been trying to do so using the margins package in R. To provide a reproducible example, I used the mtcars dataset and exported it from…
ecidonex
  • 51
  • 5
5
votes
1 answer

How can I generate marginal effects for a logit model when using survey weights?

I normally generate logit model marginal effects using the mfx package and the logitmfx function. However, the current survey I am using has weights (which have a large effect on the proportion of the DV in the sample because of oversampling in some…
Jon M
  • 1,157
  • 1
  • 10
  • 16
4
votes
1 answer

Computing marginal effects: Why does ggeffect and ggemmeans give difference answers?

Example library(glmmTMB) library(ggeffects) ## Zero-inflated negative binomial model (m <- glmmTMB(count ~ spp + mined + (1|site), ziformula=~spp + mined, family=nbinom2, data=Salamanders, …
Constantin
  • 132
  • 9
4
votes
0 answers

How do you compute average marginal effects for glm.cluster models?

I am looking for a way to compute average marginal effects with clustered standard errors which i seem to be having a few problems with. My model is as follows: cseLogit <- miceadds::glm.cluster(data = data_long, …
4
votes
2 answers

R probit regression marginal effects

I am using R to replicate a study and obtain mostly the same results the author reported. At one point, however, I calculate marginal effects that seem to be unrealistically small. I would greatly appreciate if you could have a look at my reasoning…
Tobias
  • 45
  • 1
  • 3
4
votes
3 answers

Probit Marginal Effects output for Latex

I am computing probit marginal effects from R mfx package. I want to generate Latex code for the marginal effects output. I tried stargazer package for OLS and probit coefficients, it works fine for both, however for probit marginal effects (by…
Researcher
  • 149
  • 1
  • 8
4
votes
1 answer

Marginal effects of logit in weighted survey data using R

I´m trying to estimate marginal effect of a logit model in which I have several dichotomous explanatory variables. Let's say the model estimated by logit<- svyglm ( if_member ~ if_female + dummy_agegroup_2 + dummy_agegroup_3 + dummy_education_2 +…
david_sst
  • 55
  • 6
3
votes
1 answer

Redefining R's nnet::multinom predict.multinom predict method to support type="link"

I would like to have R's nnet::multinom function being supported by the new marginaleffects package, but marginaleffects::predictions() relies on the predict() methods supplied by the modeling packages to compute predicted values on both the…
Tom Wenseleers
  • 7,535
  • 7
  • 63
  • 103
3
votes
1 answer

How to extract average marginal effects (or predicted values) following panel data in Julia?

I am using this helpful package https://github.com/FixedEffects/FixedEffectModels.jl in Julia which helps to run Fixed Effects models. I have one problem though, i am not sure how to extract the average marginal effects or predicted values of an…
Jack
  • 813
  • 4
  • 17
3
votes
1 answer

multiple imputation, lmer, and pooling ggeffects objects

I computed linear mixed effects models using lme4::lmer() on data that I multiply imputed using the mice package. On these lmer objects, I want to apply ggeffects::ggeffect() to get marginal effects that I can then plot for mean, +1sd and -1sd. The…
riepenha
  • 31
  • 4
3
votes
1 answer

How to reproduce average marginal effects from xtlogit model

I am interested in reproducing average marginal effects from a random effects logit model (run in Stata using xtlogit). I understand how to reproduce the average marginal effects from a logit model using the Delta method. For instance, in the code…
1
2 3
9 10