Skip to content

Instantly share code, notes, and snippets.

@christophergandrud
Last active January 19, 2017 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christophergandrud/56a244b9897fae01b9feff7878b4d947 to your computer and use it in GitHub Desktop.
Save christophergandrud/56a244b9897fae01b9feff7878b4d947 to your computer and use it in GitHub Desktop.
# Load the Zelig package
library(Zelig)
# Initialize Zelig5 least squares object
z5 <- zls$new()
# Estimate ls model
z5$zelig(Fertility ~ Education, data = swiss)
# Set Education to 5 and 15
z5$setx(Education = 5:15)
z5$setx1(Education = 15)
# Simulate quantities of interest
z5$sim()
# Plot quantities of interest
z5$graph()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment