Skip to content

Instantly share code, notes, and snippets.

@tonicanada
Last active September 18, 2022 17:00
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 tonicanada/f325ab5c162cdcdb5ab37c9e8b305f0e to your computer and use it in GitHub Desktop.
Save tonicanada/f325ab5c162cdcdb5ab37c9e8b305f0e to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Causality // Example of Coarsened Exact Matching"
]
},
{
"cell_type": "code",
"execution_count": 99,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"import seaborn as sns\n",
"from causalinference import CausalModel"
]
},
{
"cell_type": "code",
"execution_count": 100,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Unnamed: 0</th>\n",
" <th>X</th>\n",
" <th>exp</th>\n",
" <th>wks</th>\n",
" <th>bluecol</th>\n",
" <th>ind</th>\n",
" <th>south</th>\n",
" <th>smsa</th>\n",
" <th>married</th>\n",
" <th>sex</th>\n",
" <th>union</th>\n",
" <th>ed</th>\n",
" <th>black</th>\n",
" <th>lwage</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>3</td>\n",
" <td>32</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>9</td>\n",
" <td>no</td>\n",
" <td>5.56068</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>4</td>\n",
" <td>43</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>9</td>\n",
" <td>no</td>\n",
" <td>5.72031</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3</td>\n",
" <td>3</td>\n",
" <td>5</td>\n",
" <td>40</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>9</td>\n",
" <td>no</td>\n",
" <td>5.99645</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>4</td>\n",
" <td>4</td>\n",
" <td>6</td>\n",
" <td>39</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>9</td>\n",
" <td>no</td>\n",
" <td>5.99645</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>5</td>\n",
" <td>5</td>\n",
" <td>7</td>\n",
" <td>42</td>\n",
" <td>no</td>\n",
" <td>1</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>9</td>\n",
" <td>no</td>\n",
" <td>6.06146</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4160</th>\n",
" <td>4161</td>\n",
" <td>4161</td>\n",
" <td>3</td>\n",
" <td>50</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>female</td>\n",
" <td>no</td>\n",
" <td>12</td>\n",
" <td>no</td>\n",
" <td>5.95324</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4161</th>\n",
" <td>4162</td>\n",
" <td>4162</td>\n",
" <td>4</td>\n",
" <td>49</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>female</td>\n",
" <td>no</td>\n",
" <td>12</td>\n",
" <td>no</td>\n",
" <td>6.06379</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4162</th>\n",
" <td>4163</td>\n",
" <td>4163</td>\n",
" <td>5</td>\n",
" <td>50</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>female</td>\n",
" <td>no</td>\n",
" <td>12</td>\n",
" <td>no</td>\n",
" <td>6.21461</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4163</th>\n",
" <td>4164</td>\n",
" <td>4164</td>\n",
" <td>6</td>\n",
" <td>50</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>female</td>\n",
" <td>no</td>\n",
" <td>12</td>\n",
" <td>no</td>\n",
" <td>6.29157</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4164</th>\n",
" <td>4165</td>\n",
" <td>4165</td>\n",
" <td>7</td>\n",
" <td>50</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>female</td>\n",
" <td>no</td>\n",
" <td>12</td>\n",
" <td>no</td>\n",
" <td>6.37161</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>4165 rows × 14 columns</p>\n",
"</div>"
],
"text/plain": [
" Unnamed: 0 X exp wks bluecol ind south smsa married sex \\\n",
"0 1 1 3 32 no 0 yes no yes male \n",
"1 2 2 4 43 no 0 yes no yes male \n",
"2 3 3 5 40 no 0 yes no yes male \n",
"3 4 4 6 39 no 0 yes no yes male \n",
"4 5 5 7 42 no 1 yes no yes male \n",
"... ... ... ... ... ... ... ... ... ... ... \n",
"4160 4161 4161 3 50 no 0 no yes no female \n",
"4161 4162 4162 4 49 no 0 no yes no female \n",
"4162 4163 4163 5 50 no 0 no yes no female \n",
"4163 4164 4164 6 50 no 0 no yes no female \n",
"4164 4165 4165 7 50 no 0 no yes no female \n",
"\n",
" union ed black lwage \n",
"0 no 9 no 5.56068 \n",
"1 no 9 no 5.72031 \n",
"2 no 9 no 5.99645 \n",
"3 no 9 no 5.99645 \n",
"4 no 9 no 6.06146 \n",
"... ... .. ... ... \n",
"4160 no 12 no 5.95324 \n",
"4161 no 12 no 6.06379 \n",
"4162 no 12 no 6.21461 \n",
"4163 no 12 no 6.29157 \n",
"4164 no 12 no 6.37161 \n",
"\n",
"[4165 rows x 14 columns]"
]
},
"execution_count": 100,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = pd.read_csv(\"wages_dataset.csv\")\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 101,
"metadata": {},
"outputs": [],
"source": [
"# We are going to analyze the effect of being in a union, in the wage employee.\n",
"# We expect that their salary will increase if they are in a union."
]
},
{
"cell_type": "code",
"execution_count": 102,
"metadata": {},
"outputs": [],
"source": [
"df['exp'] = pd.cut(x=df.exp, bins=4).astype(str)\n",
"df['ed'] = pd.cut(x=df.ed, bins=4).astype(str)\n",
"df = df.drop(columns=[\"Unnamed: 0\", \"X\", \"wks\"])"
]
},
{
"cell_type": "code",
"execution_count": 103,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>exp</th>\n",
" <th>ed</th>\n",
" <th>bluecol</th>\n",
" <th>ind</th>\n",
" <th>south</th>\n",
" <th>smsa</th>\n",
" <th>married</th>\n",
" <th>sex</th>\n",
" <th>black</th>\n",
" <th>lwage</th>\n",
" <th>union</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.329370</td>\n",
" <td>yes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.815571</td>\n",
" <td>yes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>male</td>\n",
" <td>yes</td>\n",
" <td>6.408530</td>\n",
" <td>yes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.109250</td>\n",
" <td>yes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>yes</td>\n",
" <td>6.288805</td>\n",
" <td>yes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>163</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.548400</td>\n",
" <td>yes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>164</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>yes</td>\n",
" <td>7.002035</td>\n",
" <td>yes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>165</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>1</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.932155</td>\n",
" <td>yes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>166</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>1</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.307395</td>\n",
" <td>yes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>167</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>1</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.690387</td>\n",
" <td>yes</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>168 rows × 11 columns</p>\n",
"</div>"
],
"text/plain": [
" exp ed bluecol ind south smsa married sex black \\\n",
"0 (0.95, 13.5] (10.5, 13.75] no 0 no no yes male no \n",
"1 (0.95, 13.5] (10.5, 13.75] no 0 no yes yes male no \n",
"2 (0.95, 13.5] (10.5, 13.75] no 0 yes yes no male yes \n",
"3 (0.95, 13.5] (10.5, 13.75] no 0 yes yes yes male no \n",
"4 (0.95, 13.5] (10.5, 13.75] no 0 yes yes yes male yes \n",
".. ... ... ... ... ... ... ... ... ... \n",
"163 (38.5, 51.0] (7.25, 10.5] yes 0 yes no yes male no \n",
"164 (38.5, 51.0] (7.25, 10.5] yes 0 yes no yes male yes \n",
"165 (38.5, 51.0] (7.25, 10.5] yes 1 no no no male no \n",
"166 (38.5, 51.0] (7.25, 10.5] yes 1 no no yes male no \n",
"167 (38.5, 51.0] (7.25, 10.5] yes 1 no yes yes male no \n",
"\n",
" lwage union \n",
"0 6.329370 yes \n",
"1 6.815571 yes \n",
"2 6.408530 yes \n",
"3 6.109250 yes \n",
"4 6.288805 yes \n",
".. ... ... \n",
"163 6.548400 yes \n",
"164 7.002035 yes \n",
"165 6.932155 yes \n",
"166 6.307395 yes \n",
"167 6.690387 yes \n",
"\n",
"[168 rows x 11 columns]"
]
},
"execution_count": 103,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_union = df[df.union=='yes']\n",
"df_union = df_union.groupby([\"exp\", \"ed\", \"bluecol\", \"ind\", \"south\", \"smsa\", \"married\", \"sex\", \"black\"]).mean().reset_index()\n",
"df_union['union'] = 'yes'\n",
"df_union"
]
},
{
"cell_type": "code",
"execution_count": 104,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>exp</th>\n",
" <th>ed</th>\n",
" <th>bluecol</th>\n",
" <th>ind</th>\n",
" <th>south</th>\n",
" <th>smsa</th>\n",
" <th>married</th>\n",
" <th>sex</th>\n",
" <th>black</th>\n",
" <th>lwage</th>\n",
" <th>union</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>female</td>\n",
" <td>no</td>\n",
" <td>5.831959</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.294982</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>yes</td>\n",
" <td>6.128487</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>female</td>\n",
" <td>no</td>\n",
" <td>6.224900</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.627557</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>252</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.027937</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>253</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.764727</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>254</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.103137</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>255</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>female</td>\n",
" <td>yes</td>\n",
" <td>5.336400</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>256</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>1</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>5.850335</td>\n",
" <td>no</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>257 rows × 11 columns</p>\n",
"</div>"
],
"text/plain": [
" exp ed bluecol ind south smsa married sex \\\n",
"0 (0.95, 13.5] (10.5, 13.75] no 0 no no no female \n",
"1 (0.95, 13.5] (10.5, 13.75] no 0 no no yes male \n",
"2 (0.95, 13.5] (10.5, 13.75] no 0 no no yes male \n",
"3 (0.95, 13.5] (10.5, 13.75] no 0 no yes no female \n",
"4 (0.95, 13.5] (10.5, 13.75] no 0 no yes no male \n",
".. ... ... ... ... ... ... ... ... \n",
"252 (38.5, 51.0] (7.25, 10.5] yes 0 no no yes male \n",
"253 (38.5, 51.0] (7.25, 10.5] yes 0 no yes yes male \n",
"254 (38.5, 51.0] (7.25, 10.5] yes 0 yes no yes male \n",
"255 (38.5, 51.0] (7.25, 10.5] yes 0 yes yes no female \n",
"256 (38.5, 51.0] (7.25, 10.5] yes 1 no no yes male \n",
"\n",
" black lwage union \n",
"0 no 5.831959 no \n",
"1 no 6.294982 no \n",
"2 yes 6.128487 no \n",
"3 no 6.224900 no \n",
"4 no 6.627557 no \n",
".. ... ... ... \n",
"252 no 6.027937 no \n",
"253 no 6.764727 no \n",
"254 no 6.103137 no \n",
"255 yes 5.336400 no \n",
"256 no 5.850335 no \n",
"\n",
"[257 rows x 11 columns]"
]
},
"execution_count": 104,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_nonunion = df[df.union=='no']\n",
"df_nonunion = df_nonunion.groupby(by=[\"exp\", \"ed\", \"bluecol\", \"ind\", \"south\", \"smsa\", \"married\", \"sex\", \"black\"]).mean().reset_index()\n",
"df_nonunion['union'] = 'no'\n",
"df_nonunion"
]
},
{
"cell_type": "code",
"execution_count": 105,
"metadata": {},
"outputs": [],
"source": [
"df_match = pd.merge(df_union, df_nonunion, how='inner', on=[\"exp\", \"ed\", \"bluecol\", \"ind\", \"south\", \"smsa\", \"married\", \"sex\", \"black\"])"
]
},
{
"cell_type": "code",
"execution_count": 106,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>exp</th>\n",
" <th>ed</th>\n",
" <th>bluecol</th>\n",
" <th>ind</th>\n",
" <th>south</th>\n",
" <th>smsa</th>\n",
" <th>married</th>\n",
" <th>sex</th>\n",
" <th>black</th>\n",
" <th>lwage_x</th>\n",
" <th>union_x</th>\n",
" <th>lwage_y</th>\n",
" <th>union_y</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.329370</td>\n",
" <td>yes</td>\n",
" <td>6.294982</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.815571</td>\n",
" <td>yes</td>\n",
" <td>6.635483</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.109250</td>\n",
" <td>yes</td>\n",
" <td>6.641334</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>1</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.643763</td>\n",
" <td>yes</td>\n",
" <td>6.592487</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>(0.95, 13.5]</td>\n",
" <td>(10.5, 13.75]</td>\n",
" <td>no</td>\n",
" <td>1</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.513230</td>\n",
" <td>yes</td>\n",
" <td>7.600900</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>101</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(3.987, 7.25]</td>\n",
" <td>yes</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>7.238325</td>\n",
" <td>yes</td>\n",
" <td>6.669915</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>102</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(3.987, 7.25]</td>\n",
" <td>yes</td>\n",
" <td>1</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.907760</td>\n",
" <td>yes</td>\n",
" <td>6.205143</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>103</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>0</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.535100</td>\n",
" <td>yes</td>\n",
" <td>6.764727</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>104</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>0</td>\n",
" <td>yes</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.548400</td>\n",
" <td>yes</td>\n",
" <td>6.103137</td>\n",
" <td>no</td>\n",
" </tr>\n",
" <tr>\n",
" <th>105</th>\n",
" <td>(38.5, 51.0]</td>\n",
" <td>(7.25, 10.5]</td>\n",
" <td>yes</td>\n",
" <td>1</td>\n",
" <td>no</td>\n",
" <td>no</td>\n",
" <td>yes</td>\n",
" <td>male</td>\n",
" <td>no</td>\n",
" <td>6.307395</td>\n",
" <td>yes</td>\n",
" <td>5.850335</td>\n",
" <td>no</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>106 rows × 13 columns</p>\n",
"</div>"
],
"text/plain": [
" exp ed bluecol ind south smsa married sex black \\\n",
"0 (0.95, 13.5] (10.5, 13.75] no 0 no no yes male no \n",
"1 (0.95, 13.5] (10.5, 13.75] no 0 no yes yes male no \n",
"2 (0.95, 13.5] (10.5, 13.75] no 0 yes yes yes male no \n",
"3 (0.95, 13.5] (10.5, 13.75] no 1 no no yes male no \n",
"4 (0.95, 13.5] (10.5, 13.75] no 1 no yes no male no \n",
".. ... ... ... ... ... ... ... ... ... \n",
"101 (38.5, 51.0] (3.987, 7.25] yes 0 no yes yes male no \n",
"102 (38.5, 51.0] (3.987, 7.25] yes 1 yes no yes male no \n",
"103 (38.5, 51.0] (7.25, 10.5] yes 0 no yes yes male no \n",
"104 (38.5, 51.0] (7.25, 10.5] yes 0 yes no yes male no \n",
"105 (38.5, 51.0] (7.25, 10.5] yes 1 no no yes male no \n",
"\n",
" lwage_x union_x lwage_y union_y \n",
"0 6.329370 yes 6.294982 no \n",
"1 6.815571 yes 6.635483 no \n",
"2 6.109250 yes 6.641334 no \n",
"3 6.643763 yes 6.592487 no \n",
"4 6.513230 yes 7.600900 no \n",
".. ... ... ... ... \n",
"101 7.238325 yes 6.669915 no \n",
"102 6.907760 yes 6.205143 no \n",
"103 6.535100 yes 6.764727 no \n",
"104 6.548400 yes 6.103137 no \n",
"105 6.307395 yes 5.850335 no \n",
"\n",
"[106 rows x 13 columns]"
]
},
"execution_count": 106,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_match"
]
},
{
"cell_type": "code",
"execution_count": 107,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"6.664483039068413"
]
},
"execution_count": 107,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_match['lwage_x'].mean()"
]
},
{
"cell_type": "code",
"execution_count": 108,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"6.560202419278689"
]
},
"execution_count": 108,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_match['lwage_y'].mean()"
]
},
{
"cell_type": "code",
"execution_count": 109,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.1042806197897237"
]
},
"execution_count": 109,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_match['lwage_x'].mean() - df_match['lwage_y'].mean()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"0.1 difference in log wage = 10% difference in wage <br>\n",
"If you are in a union, your salary is going to be 10% higher."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We found 106 matching groups, and:\n",
"* 168 - 106 = 62\n",
"* 257 - 106 = 151\n",
"______________\n",
"213 not matched"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Common Support Region"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We use multinomial logistic regression to predict the probabilities of someone being treated or not, then we can plot the 2 density curves and see the areas intersection. As big as this area is, means more control groups we can build, and better the quality of matching output is going to be."
]
},
{
"cell_type": "code",
"execution_count": 110,
"metadata": {},
"outputs": [],
"source": [
"df_csr = pd.get_dummies(df, drop_first=True)\n",
"confounders = df_csr.drop(columns=[\"lwage\", \"union_yes\"]).values\n",
"treat = df_csr['union_yes'].values"
]
},
{
"cell_type": "code",
"execution_count": 111,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Optimization terminated successfully.\n",
" Current function value: inf\n",
" Iterations 6\n",
" Logit Regression Results \n",
"==============================================================================\n",
"Dep. Variable: y No. Observations: 4165\n",
"Model: Logit Df Residuals: 4151\n",
"Method: MLE Df Model: 13\n",
"Date: Sun, 18 Sep 2022 Pseudo R-squ.: inf\n",
"Time: 13:54:53 Log-Likelihood: -inf\n",
"converged: True LL-Null: 0.0000\n",
"Covariance Type: nonrobust LLR p-value: 1.000\n",
"==============================================================================\n",
" coef std err z P>|z| [0.025 0.975]\n",
"------------------------------------------------------------------------------\n",
"const -2.3585 0.175 -13.453 0.000 -2.702 -2.015\n",
"x1 0.1692 0.076 2.223 0.026 0.020 0.318\n",
"x2 0.1476 0.089 1.661 0.097 -0.027 0.322\n",
"x3 -0.0388 0.098 -0.396 0.692 -0.231 0.153\n",
"x4 -0.3089 0.166 -1.863 0.062 -0.634 0.016\n",
"x5 1.5587 0.094 16.525 0.000 1.374 1.744\n",
"x6 -1.0147 0.089 -11.445 0.000 -1.189 -0.841\n",
"x7 0.5073 0.081 6.234 0.000 0.348 0.667\n",
"x8 0.5291 0.143 3.688 0.000 0.248 0.810\n",
"x9 0.4264 0.185 2.303 0.021 0.064 0.789\n",
"x10 -0.4574 0.100 -4.562 0.000 -0.654 -0.261\n",
"x11 -0.3707 0.197 -1.880 0.060 -0.757 0.016\n",
"x12 0.3558 0.108 3.285 0.001 0.144 0.568\n",
"x13 0.5470 0.144 3.795 0.000 0.265 0.830\n",
"==============================================================================\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/statsmodels/discrete/discrete_model.py:1819: RuntimeWarning: overflow encountered in exp\n",
" return 1/(1+np.exp(-X))\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/statsmodels/discrete/discrete_model.py:1872: RuntimeWarning: divide by zero encountered in log\n",
" return np.sum(np.log(self.cdf(q*np.dot(X,params))))\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/statsmodels/base/model.py:592: HessianInversionWarning: Inverting hessian failed, no bse or cov_params available\n",
" warnings.warn('Inverting hessian failed, no bse or cov_params '\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/statsmodels/base/model.py:592: HessianInversionWarning: Inverting hessian failed, no bse or cov_params available\n",
" warnings.warn('Inverting hessian failed, no bse or cov_params '\n"
]
}
],
"source": [
"# Logistic Regression\n",
"import statsmodels.api as sm\n",
"confounders_csr = sm.add_constant(confounders)\n",
"csr_model = sm.Logit(treat, confounders_csr).fit()\n",
"print(csr_model.summary())"
]
},
{
"cell_type": "code",
"execution_count": 112,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([0.11285631, 0.11285631, 0.11285631, ..., 0.13572532, 0.13572532,\n",
" 0.13572532])"
]
},
"execution_count": 112,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Predictions\n",
"probabilities = csr_model.predict(confounders_csr)\n",
"probabilities"
]
},
{
"cell_type": "code",
"execution_count": 113,
"metadata": {},
"outputs": [],
"source": [
"# Split between treated and non treated\n",
"df_prob = np.vstack([treat, probabilities])\n",
"df_prob = np.transpose(df_prob)\n",
"non_treated = df_prob[:, 0] == 0\n",
"non_treated = df_prob[non_treated]\n",
"non_treated = non_treated[:,1]"
]
},
{
"cell_type": "code",
"execution_count": 114,
"metadata": {},
"outputs": [],
"source": [
"treated = df_prob[:, 0] == 1\n",
"treated = df_prob[treated]\n",
"treated = treated[:,1]"
]
},
{
"cell_type": "code",
"execution_count": 115,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAD4CAYAAAAD6PrjAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAA1M0lEQVR4nO3dd3hUZfbA8e9JCDUU6b2HEjpEBEFFUaQoqGAX0VVQEXvvrqJiV+zY1rI/e0NFsaCIqEjoTZQmHULvBJL398cZ2Cwbkklm7twp5/M885By595zSTJn3nZecc5hjDHGACT5HYAxxpjoYUnBGGPMQZYUjDHGH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rnHAwU83xKR1s658G3gHIOspRC6RCnnEcx9IiInAncA/Z1zeyMUW7gUdo/lgdbAjyKyDO2jHRuDg83B/CxXAmOdc/ucc0vRMvg+7QRQLMHc4yXA+wDOuV+B0mgRuXgS1N9tXpYUQpco5TwKvU8R6QC8hCaEWOuDhkLu0Tm31TlX1TnX0DnXEB036e+ci+BWgGERzO/sp2grARGpinYnLYlgjKEK5h6XAz0BRKQlmhSyIhql98YCFwZmIXUBtjrn1hT0BOs+CpFLkHIeQd7no0Aq8EFgHH25c66/b0EXUZD3GPOCvM/xQC8RmQ/kADc552KmdRvkPd4AvCwi16GDzhfF2ps1EXkHTd5VA2Mj9wApAM65F9Gxkr7AImAXcHGh54yx/wNjjDEesu4jY4wxB1lSMMYYc5AlBWOMMQdZUjDGGHOQJQVjjDEHWVIwxhhzkCUFY4wxB/0/M01NQ6bwzzcAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# Common Support Region\n",
"plot_non_treated = sns.kdeplot(non_treated, shade = True, color = 'red')\n",
"plot_treated = sns.kdeplot(treated, shade = True, color = 'blue')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Matching via other technique (Causal Inference library)"
]
},
{
"cell_type": "code",
"execution_count": 118,
"metadata": {},
"outputs": [],
"source": [
"y = df.lwage.values"
]
},
{
"cell_type": "code",
"execution_count": 119,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Treatment Effect Estimates: Matching\n",
"\n",
" Est. S.e. z P>|z| [95% Conf. int.]\n",
"--------------------------------------------------------------------------------\n",
" ATE 0.048 0.020 2.366 0.018 0.008 0.088\n",
" ATC 0.020 0.024 0.813 0.416 -0.028 0.068\n",
" ATT 0.097 0.025 3.917 0.000 0.049 0.146\n",
"\n"
]
}
],
"source": [
"model = CausalModel(y, treat, confounders)\n",
"model.est_via_matching(bias_adj=True)\n",
"print(model.estimates)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Using this technique, we find that an employee unionized will have 0.048 greater lwage. We usually look at ATE (average treatment effect)."
]
},
{
"cell_type": "code",
"execution_count": 120,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.048083589298889784"
]
},
"execution_count": 120,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"model.estimates['matching']['ate']"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Robustness: Repeated experiments"
]
},
{
"cell_type": "code",
"execution_count": 121,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n",
"2\n",
"3\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"4\n",
"5\n",
"6\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"7\n",
"8\n",
"9\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"10\n",
"11\n",
"12\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"13\n",
"14\n",
"15\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"16\n",
"17\n",
"18\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"19\n",
"20\n",
"21\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"22\n",
"23\n",
"24\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"25\n",
"26\n",
"27\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"28\n",
"29\n",
"30\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"31\n",
"32\n",
"33\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"34\n",
"35\n",
"36\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"37\n",
"38\n",
"39\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"40\n",
"41\n",
"42\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"43\n",
"44\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"45\n",
"46\n",
"47\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"48\n",
"49\n",
"50\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"51\n",
"52\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"53\n",
"54\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"55\n",
"56\n",
"57\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"58\n",
"59\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"60\n",
"61\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"62\n",
"63\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"64\n",
"65\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"66\n",
"67\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"68\n",
"69\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"70\n",
"71\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"72\n",
"73\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"74\n",
"75\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"76\n",
"77\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"78\n",
"79\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"80\n",
"81\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"82\n",
"83\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"84\n",
"85\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"86\n",
"87\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"88\n",
"89\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"90\n",
"91\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"92\n",
"93\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"94\n",
"95\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"96\n",
"97\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n",
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"98\n",
"99\n",
"100\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/acm/anaconda3/lib/python3.8/site-packages/causalinference/estimators/matching.py:100: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.\n",
"To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.\n",
" return np.linalg.lstsq(X, Y)[0][1:] # don't need intercept coef\n"
]
}
],
"source": [
"#prepare for the loop\n",
"ate = {}\n",
"i = 0\n",
"#start the loop\n",
"while i < 100:\n",
" #sample\n",
" sample = df_csr.sample(1000)\n",
" #matching preparation\n",
" treat = sample.union_yes.values\n",
" confounders = sample.drop(columns=['lwage', 'union_yes']).values\n",
" y = sample.lwage.values\n",
" #matching\n",
" model = CausalModel(y, treat, confounders)\n",
" model.est_via_matching(bias_adj=True)\n",
" #store results\n",
" ate[i] = model.estimates['matching']['ate']\n",
" i = i + 1\n",
" print(i)"
]
},
{
"cell_type": "code",
"execution_count": 122,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"AxesSubplot(0.125,0.125;0.775x0.755)\n",
"0.04686822766498973\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMA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Q2JLdLu9x3lXA96l+4/+BrO3DwBuy6edTPdpjB/Bt4BU1634gW+9henh0ULcyA39JdR/slprbS/s5c902rqLAQt+F18efUP0CeSsNPvD0W2ZgKGvfRrXI/3mfPdevpvqf0pNU/wPZVrPu0+rJfN18CQQzs8Q9W466MTN71nKhNzNLnAu9mVniXOjNzBLnQm9mljgXejOzxLnQm5kl7v8ADh+3go7bCBcAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"#Visualization\n",
"ate = pd.Series(ate)\n",
"print(ate.hist())\n",
"print(ate.mean())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Robustness: Removing one confounder"
]
},
{
"cell_type": "code",
"execution_count": 123,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>ind</th>\n",
" <th>lwage</th>\n",
" <th>exp_(13.5, 26.0]</th>\n",
" <th>exp_(26.0, 38.5]</th>\n",
" <th>exp_(38.5, 51.0]</th>\n",
" <th>bluecol_yes</th>\n",
" <th>south_yes</th>\n",
" <th>smsa_yes</th>\n",
" <th>married_yes</th>\n",
" <th>sex_male</th>\n",
" <th>union_yes</th>\n",
" <th>ed_(13.75, 17.0]</th>\n",
" <th>ed_(3.987, 7.25]</th>\n",
" <th>ed_(7.25, 10.5]</th>\n",
" <th>black_yes</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0</td>\n",
" <td>5.56068</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>0</td>\n",
" <td>5.72031</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>0</td>\n",
" <td>5.99645</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>0</td>\n",
" <td>5.99645</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1</td>\n",
" <td>6.06146</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4160</th>\n",
" <td>0</td>\n",
" <td>5.95324</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4161</th>\n",
" <td>0</td>\n",
" <td>6.06379</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4162</th>\n",
" <td>0</td>\n",
" <td>6.21461</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4163</th>\n",
" <td>0</td>\n",
" <td>6.29157</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4164</th>\n",
" <td>0</td>\n",
" <td>6.37161</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>4165 rows × 15 columns</p>\n",
"</div>"
],
"text/plain": [
" ind lwage exp_(13.5, 26.0] exp_(26.0, 38.5] exp_(38.5, 51.0] \\\n",
"0 0 5.56068 0 0 0 \n",
"1 0 5.72031 0 0 0 \n",
"2 0 5.99645 0 0 0 \n",
"3 0 5.99645 0 0 0 \n",
"4 1 6.06146 0 0 0 \n",
"... ... ... ... ... ... \n",
"4160 0 5.95324 0 0 0 \n",
"4161 0 6.06379 0 0 0 \n",
"4162 0 6.21461 0 0 0 \n",
"4163 0 6.29157 0 0 0 \n",
"4164 0 6.37161 0 0 0 \n",
"\n",
" bluecol_yes south_yes smsa_yes married_yes sex_male union_yes \\\n",
"0 0 1 0 1 1 0 \n",
"1 0 1 0 1 1 0 \n",
"2 0 1 0 1 1 0 \n",
"3 0 1 0 1 1 0 \n",
"4 0 1 0 1 1 0 \n",
"... ... ... ... ... ... ... \n",
"4160 0 0 1 0 0 0 \n",
"4161 0 0 1 0 0 0 \n",
"4162 0 0 1 0 0 0 \n",
"4163 0 0 1 0 0 0 \n",
"4164 0 0 1 0 0 0 \n",
"\n",
" ed_(13.75, 17.0] ed_(3.987, 7.25] ed_(7.25, 10.5] black_yes \n",
"0 0 0 1 0 \n",
"1 0 0 1 0 \n",
"2 0 0 1 0 \n",
"3 0 0 1 0 \n",
"4 0 0 1 0 \n",
"... ... ... ... ... \n",
"4160 0 0 0 0 \n",
"4161 0 0 0 0 \n",
"4162 0 0 0 0 \n",
"4163 0 0 0 0 \n",
"4164 0 0 0 0 \n",
"\n",
"[4165 rows x 15 columns]"
]
},
"execution_count": 123,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_csr"
]
},
{
"cell_type": "code",
"execution_count": 124,
"metadata": {},
"outputs": [],
"source": [
"#New confounder list\n",
"confounder = df_csr.drop(columns=['lwage', \n",
" 'union_yes', \n",
" 'sex_male']).values"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#Matching\n",
"treat = df_csr.union_yes.values\n",
"y = df_c.score_standardized.values\n",
"model = CausalModel(y, treat, confounder)\n",
"model.est_via_matching(bias_adj=True)\n",
"print(model.estimates)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment