marginaleffects R package: correct syntax for predictions function using map
I am trying to compute predictions using the R::marginaleffects package. I would like to do this several times for specific predictor variables of interest, within a map / apply like function, but am struggling to get the syntax right. My attempt is:
marginaleffects R package: correct syntax for predictions function using map
I am trying to compute predictions using the R::marginaleffects package. I would like to do this several times for specific predictor variables of interest, within a map / apply like function, but am struggling to get the syntax right. My attempt is:
Issues with Interaction Terms in slopes() Function from marginaleffects
I am using the marginaleffects package in R to calculate marginal effects from a multinomial logistic regression model (MNL) that includes an interaction term. I want to calculate the Marginal Effects at the Mean (MEM) for each term in the MNL; the marginaleffects documentation refers me to the slopes function with the argument newdata = means. My MNL contains an interaction term, and the slopes function does not seem to be recognized correctly. Here’s a summary of my problem and what I’ve tried:
R: Plot sensitivity to marginal change in one variable (1%) as a function of second variable with confidence intervals
I have intermediate expertise of R and limited knowledge in statistics. I run the following simplified (removed control variables) regression: