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
3
votes
1 answer
Using ggpredict() and ggplot2() with scaled continuous variables and trying to unscale them
I am trying to plot the marginal-effects for a mixed model with a binomial logit link function.
My issue is that I initially run the model with scaled continuous variables, which I then use within the ggpredict() function.
However, when I try to…

Hiral Shah
- 31
- 2
3
votes
1 answer
How to plot marginal effect of an interaction after felm() function
I ran a regression based on a "giant" panel data with a bunch of unit fixed effects. So I employed function "felm()" from package "lfe". In addition, I have an interaction term of two continuous variables in the regression. But when plotting how the…

Ronald
- 61
- 6
3
votes
1 answer
Issue with calculating marginal effects for an ordered logit model in R with ocME
I am attempting to estimate an ordered logit model incl. the marginal effects in R through following the code from this tutorial. I am using polr from the MASS package to estimate the model and ocME from the erer package to attempt to calculate the…

David Metcalf
- 664
- 1
- 7
- 13
3
votes
2 answers
How to solve mlogit marginal effects error?
After successfully running the mlogit model in R, I get an error trying to obtain marginal effects that says:
"Error in predict.mlogit(object, data) : the number of rows of the data.frame should be a multiple of the number of alternatives"
I have…

Ed.
- 31
- 4
3
votes
1 answer
mfxboot function for marginal effects for probit regressions?
Data: Data
Code:
#function that calculates ‘the average of the sample marginal effects’.
mfxboot <- function(modform,dist,data,boot=1000,digits=3){
x <- glm(modform, family=binomial(link=dist),data)
# get marginal effects
pdf <-…

iouraich
- 2,944
- 5
- 29
- 40
3
votes
2 answers
marginal effects of mlogit in R
I am new to R, and I don't understand yet completely the logic of its calculations...
I cannot overcome my problem with the help from previous posts either.
I have a data set of about 600 observations for 11 variables. I have successfully run the…

Zyta
- 73
- 1
- 7
3
votes
1 answer
Can the effects package in R be used for lm models with no intercepts?
Can the effects package in R be used to plot (marginal) effects for a linear model which does not include an intercept?
Here is some R code I tried for such a model:
x <- seq(1,100,by=0.1)
y <- 1 + 2*x + rnorm(n=length(x))
model <- lm(y ~ 0 +…

Isabella Ghement
- 715
- 6
- 14
2
votes
3 answers
Creating a 'marginsplot' in R
Inspired by this youtube https://www.youtube.com/watch?v=7maMbX_65b0 by the ever fantastic Chuck Huber, how can I recreate the marginsplot of Stata in R?
In other words, for my cplot() line at the end of the code block, how can I get the plot to…

Sandro
- 101
- 7
2
votes
0 answers
How to calculate the marginal effect of lasso logistic regression?
I have seen the method of calculating marginal effect for glm, gam and polr packages, but how to calculate marginal effect for lasso regression, such as glmnet packages?
Is it extracting the coefficients of lasso regression and then calculating the…

jiyuan min
- 21
- 1
2
votes
1 answer
Delta Method in GLM.jl
Is hypothesis testing of linear and non-linear functions of coefficients of GLM supported in Julia's GLM.jl?
I am looking for a Julia equivalent of marginaleffects package in R which uses the deltamethod() function, or the nlcom post estimation…

Moshi
- 193
- 6
2
votes
1 answer
Pooled average marginal effects from survey-weighted and multiple-imputed data
I am working with survey data and their associated weights, in addition to missing data that I imputed using mice(). The model I'm eventually running contains complex interactions between variables for which I want the average marginal effect.
This…

Gabriel Varela
- 31
- 7
2
votes
0 answers
Compute and graph predicted values for all possible levels and values from a FE logit model’s predictors
I'm waiting for the bife (binary fixed effects) package to be supported in ggeffects but in the meantime I'd 1st) like to figure out how I can replicate what ggeffects does, and (very 2nd) like to understand whether I should be using the Average…

ibm
- 744
- 7
- 14
2
votes
1 answer
How to use margins package to evaluate marginal affects at different values of the dependent variable
I am using the margins package (vignette) to well, calculate margins, with respect to an ordinal variable. The margins package is an attempt to "port the functionality of Stata’s (closed source) margins". This video (around 4:25) shows that for an…

Tom
- 2,173
- 1
- 17
- 44
2
votes
0 answers
marginal effect curve for glm logit model with clustered SE
I am using glm.cluster from miceadds package to develop a cross-sectional logit model clustered by "states". I get the exact same odds ratios in the clustered model as with an unclustered model. However the standard errors change between two models,…

praveen mishra
- 21
- 1
- 2
2
votes
0 answers
Calculate marginal effects with the "margins" function
I am trying to calculate marginal effects with the margins() function but it returns an error: Error in jacobian %*% vcov : non-conformable arguments. What is this problem? How to solve that?
ml <-…

cliu
- 933
- 6
- 13