Marginal effects in regression analysis show how an explained variable changes when a particular explanatory variable changes ceteris paribus.
Questions tagged [marginal-effects]
147 questions
2
votes
2 answers
Are there packages in Julia that estimates the marginal means or marginal effects?
I am new to Julia and i estimated some multilevel regressions using Mixed Models. Everything worked perfectly fine but i would like to estimate the marginal means or marginal effects. In R there are two packages that i am aware of for that regard:…

Jack
- 813
- 4
- 17
2
votes
0 answers
Margins package in R generating NAs in results
This is my first post, so hopefully I'm doing this right.
I'm running a polr model in R and am attempting to generate some marginal effects plots using the margins package. When I view the results, everything except for the AME has a value of NA.…

amyvt98
- 21
- 2
2
votes
0 answers
Calculate Marginal effect by hand (without using packages or Stata or R) with logit and dummy variables
I have the following dilemma:
I understand-ish what marginal effects are, also the calculation of it, derivation of the sigmoid function and how to interpret it (as a the change in probability by increasing your variable of interest by "a little…

Felipe Araya
- 41
- 5
2
votes
1 answer
Test of second differences for average marginal effects in logistic regression
I have a question similar to the one here: Testing the difference between marginal effects calculated across factors. I used the same code to generate average marginal effects for two groups. The difference is that I am running a logistic rather…

IGR
- 31
- 1
2
votes
1 answer
Plot the marginal effect of different regressions in one graph
I am running the same probit regression five times but on different sets of data.
How can I plot the curve of the marginal effects for each regression on the same graph to compare them in an easy way?
Below is the code I have tried:
probit…

Vincenzoalfano
- 99
- 1
- 7
2
votes
0 answers
Average Marginal Effects in R with complex interaction terms
I am using R to compute the linear regression on the following model, as well as find the marginal effects of age on pizza at specific points (20,30,40,50,55).
mod6.22c <- lm(pizza ~ age + income + age*income +
…

Jess
- 57
- 5
2
votes
1 answer
How to get marginal effects for categorical variables in mlogit?
I want to compute marginal effects for a "mlogit" object where explanatory variables is categorical (factors). While with numerical data effects() throws something, with categorical data it won't.
For simplicity I show a bivariate example…

jay.sf
- 60,139
- 8
- 53
- 110
2
votes
0 answers
How to create a marginal effects plot for fixed effects regression with TSCS data?
I am trying to replicate a marginal effects plot for the following model
model_7 <- plm(devexp_share_totexp2 ~ enop_seatslag + turnoutconslag + ix_turnoutenop_seatslag +
devexp_share_totexp2lag + growth_newlag + log_realinc_newlag +…

Bilal
- 21
- 2
2
votes
1 answer
How to replicate Stata's "margins at" in R after lm()
From Stata:
margins, at(age=40)
To understand why that yields the desired result, let us tell you that if you were to type
. margins
margins would report the overall margin—the margin that holds nothing constant. Because our model
is logistic,…

Nata107
- 41
- 1
- 3
1
vote
1 answer
Interpret margins (after reghdfe) across groups with logged dependent variable
I want to determine the gender wage gap and use the reghdfe command to obtain a linear estimate of this:
ln_real_wage is the natural log of real annual wages.
male returns 1 for male individuals and zero elsewhere.
high_skilled_chen returns 1 for…

Michelle13
- 43
- 5
1
vote
1 answer
How to get ggeffects to use the actual offset values rather than the average
I have found very limited information on how ggeffects handles offsets. I found this article describing different ways packages in R and Stata handle offsets. I implemented the example in the website and discovered that ggpredict is estimating the…

ClaireR
- 21
- 7
1
vote
1 answer
non-parametric manova in R
I created a small example data set:
value <- rnorm(100, mean = 100, sd = 36)
group <- c(rep(c("A", "B", "C"), 33), "C")
gender <- c(rep(c("M", "F"), 50))
test <- cbind(value, group, gender)
test <- as.data.table(test)
I want to see if the mean…

Nneka
- 1,764
- 2
- 15
- 39
1
vote
0 answers
Predicting with GAM and categorical predictors in R
I have some data for multiple users and I want to generate some marginal effects for each user using GAM modelling. If I do this exercise for just a single user (John) as:
model_1 = mgcv::gam(y ~ s(speed) + s(length) + s(price), data1) with data1…

Telis
- 311
- 1
- 9
1
vote
0 answers
plotting marginal effects of multinomial logistic regression in R
UPDATE BELOW
I am running a logistic regression model in R, in which the DV has four categories, one of which, however, is the baseline. The baseline category represents the absence of the phenomenon I am predicting, whereas the other three…

Jorissimo
- 11
- 4
1
vote
1 answer
Obtaining predictions from a pooled imputation model
I want to implement a "combine then predict" approach for a logistic regression model in R. These are the steps that I already developed, using a fictive example from pima data from faraway package. Step 4 is where my issue…

usual_user16960220
- 13
- 3