Skip to content

Instantly share code, notes, and snippets.

@christophergandrud
Last active January 19, 2017 17:28
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/98fbd27cb25312985732c0bd4994a81d to your computer and use it in GitHub Desktop.
Save christophergandrud/98fbd27cb25312985732c0bd4994a81d to your computer and use it in GitHub Desktop.
# Estimate ls model
z4 <- zelig(Fertility ~ Education, data = swiss, model = 'ls')
# Set Eductation to 5 and 15
z4_set_low <- setx(z4, Education = 5)
z4_set_high <- setx(z4, Education = 15)
# Simulate results
z4_sim <- sim(z4, x = z4_set_low, x1 = z4_set_high)
# Plot simulated quantities of interest
plot(z4_sim)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment