This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
# set seed | |
#set.seed(4321) | |
# set simulation paramters | |
n <- 100 # sample size | |
x <- rnorm(n) # single explanatory variable | |
n_qi <- 100 # number of points at which to calculate the marginal effect | |
x0 <- seq(-3, 3, length.out = n_qi) # points at which to calculate the marginal effect |