Skip to content

Instantly share code, notes, and snippets.

View viniciusmss's full-sized avatar

Vinícius Miranda viniciusmss

  • Facebook
  • San Francisco
View GitHub Profile
# Load imports
library(rbounds)
library(rgenoud)
# Load data
data(lalonde)
attach(lalonde)
# Create data objects
Y <- lalonde$re78
##### DO NOT "SELECT ALL" AND EXECUTE THIS CODE ALL AT ONCE!!!
##### EXECUTE LINE-BY-LINE AND THINK ABOUT WHAT EACH LINE IS DOING.
##### RAISE YOUR HAND IF YOU HAVE QUESTIONS.
##### YOU SHOULD BE ABLE TO USE JUPYTER FOR THIS, KERNEL = R (R-PROJECT)
# If you have not done so already, install the "arm" package and load the library
install.packages("arm")
##### DO NOT "SELECT ALL" AND EXECUTE THIS CODE ALL AT ONCE!!!
##### EXECUTE LINE-BY-LINE AND THINK ABOUT WHAT EACH LINE IS DOING.
##### RAISE YOUR HAND IF YOU HAVE QUESTIONS.
##### YOU SHOULD BE ABLE TO USE JUPYTER FOR THIS, KERNEL = R (R-PROJECT)
# If you have not done so already, install the "arm" package and load the library
install.packages("arm")
library(Matching)
data(lalonde)
run_iter_maching <- function(data, iters = 3)
{
# Setting up variables
sample <- data
ctrls <- list()
treats <- list()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Quiz 2 -- More R Coding...
## This quiz covers competencies you should know by the first day of class.
## The first ten questions are intended to be basic.
## The final five questions are more advanced.
## An answer key will be provided by Monday, Aug 12.
## NOTE: Most students find it helpful to code in R using R-Studio.
## This involves installing R, and installing R-Studio, and then
## running R-Studio. Google it if you run into problems, and
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.