{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"using Plots\n",
"using Statistics\n",
"using StatsBase\n",
"using PyCall\n",
"using DataFrames\n",
"using GLM\n",
"using Tables\n",
"using XLSX\n",
"using MLBase\n",
"using RDatasets\n",
"using LsqFit"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"xvals = repeat(1:0.5:10, inner=2)\n",
"yvals = 3 .+ xvals .+ 2 .* rand(length(xvals)) .-1\n",
"scatter(xvals, yvals, color=:black, leg=false)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"find_best_fit (generic function with 1 method)"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function find_best_fit(xvals,yvals)\n",
" meanx = mean(xvals)\n",
" meany = mean(yvals)\n",
" stdx = std(xvals)\n",
" stdy = std(yvals)\n",
" r = cor(xvals,yvals)\n",
" a = r*stdy/stdx\n",
" b = meany - a*meanx\n",
" return a,b\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"38-element Vector{Float64}:\n",
" 3.9579559470764725\n",
" 3.9579559470764725\n",
" 4.4608594351932025\n",
" 4.4608594351932025\n",
" 4.9637629233099325\n",
" 4.9637629233099325\n",
" 5.466666411426663\n",
" 5.466666411426663\n",
" 5.9695698995433935\n",
" 5.9695698995433935\n",
" 6.4724733876601235\n",
" 6.4724733876601235\n",
" 6.975376875776854\n",
" ⋮\n",
" 10.495701292593967\n",
" 10.495701292593967\n",
" 10.998604780710696\n",
" 10.998604780710696\n",
" 11.501508268827429\n",
" 11.501508268827429\n",
" 12.004411756944158\n",
" 12.004411756944158\n",
" 12.507315245060887\n",
" 12.507315245060887\n",
" 13.01021873317762\n",
" 13.01021873317762"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a,b = find_best_fit(xvals,yvals)\n",
"ynew = a .* xvals .+ b"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"np = pyimport(\"numpy\");"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.261024 seconds (1.26 M allocations: 75.000 MiB, 5.50% gc time, 0.44% compilation time)\n"
]
},
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"xdata = xvals\n",
"ydata = yvals\n",
"@time myfit = np.polyfit(xdata, ydata, 1);\n",
"ynew2 = collect(xdata) .* myfit[1] .+ myfit[2];\n",
"scatter(xvals,yvals)\n",
"plot!(xvals,ynew)\n",
"plot!(xvals,ynew2)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data = DataFrame(X=xdata, Y=ydata)\n",
"ols = lm(@formula(Y ~ X), data)\n",
"plot!(xdata,predict(ols))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's get some real data. We will use housing information from zillow, check out the file `zillow_data_download_april2020.xlsx` for a quick look of what the data looks like. Our goal will be to build a linear regression model between the number of houses listed vs the number of houses sold in a few states. Fitting these models can serve as a key real estate indicator."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"XLSXFile(\"zillow_data_download_april2020.xlsx\") containing 4 Worksheets\n",
" sheetname size range \n",
"-------------------------------------------------\n",
" MonthlyListings_City 8348x91 A1:CM8348 \n",
" Sale_counts_city 28760x148 A1:ER28760 \n",
"Sales_median_price_c… 3767x148 A1:ER3767 \n",
" meta 1x1 A1:A1 \n"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# play around with data for a bit\n",
"R = XLSX.readxlsx(\"data/zillow_data_download_april2020.xlsx\")"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
| SizeRank | RegionID | RegionName | RegionType | StateName | 2013-01 | 2013-02 | 2013-03 |
|---|
| Any | Any | Any | Any | Any | Any | Any | Any |
|---|
8,347 rows × 91 columns (omitted printing of 83 columns)
| 1 | 1 | 6181 | New York | City | NY | 28904 | 28155 | 30596 |
|---|
| 2 | 2 | 12447 | Los Angeles | City | CA | 6431 | 6613 | 6467 |
|---|
| 3 | 3 | 39051 | Houston | City | TX | 11696 | 11737 | 12291 |
|---|
| 4 | 4 | 17426 | Chicago | City | IL | 9523 | 9609 | 9772 |
|---|
| 5 | 5 | 6915 | San Antonio | City | TX | 7223 | 7170 | 7438 |
|---|
| 6 | 6 | 13271 | Philadelphia | City | PA | 7505 | 7266 | 7578 |
|---|
| 7 | 7 | 40326 | Phoenix | City | AZ | 6232 | 5720 | 5872 |
|---|
| 8 | 8 | 18959 | Las Vegas | City | NV | 7027 | 6218 | 6199 |
|---|
| 9 | 9 | 54296 | San Diego | City | CA | 4121 | 3844 | 3932 |
|---|
| 10 | 10 | 38128 | Dallas | City | TX | 4332 | 4395 | 4568 |
|---|
| 11 | 11 | 10221 | Austin | City | TX | 2345 | 2230 | 2301 |
|---|
| 12 | 12 | 33839 | San Jose | City | CA | missing | missing | missing |
|---|
| 13 | 13 | 25290 | Jacksonville | City | FL | 4517 | 4495 | 4481 |
|---|
| 14 | 14 | 24043 | Charlotte | City | NC | 4550 | 4451 | 4812 |
|---|
| 15 | 15 | 18172 | Fort Worth | City | TX | 3709 | 3738 | 3703 |
|---|
| 16 | 16 | 7481 | Tucson | City | AZ | 4422 | 4355 | 4376 |
|---|
| 17 | 17 | 10920 | Columbus | City | OH | 3873 | 3849 | 4099 |
|---|
| 18 | 18 | 12455 | Louisville | City | KY | 3517 | 3355 | 3567 |
|---|
| 19 | 19 | 13121 | Orlando | City | FL | 2821 | 2781 | 2711 |
|---|
| 20 | 20 | 17933 | El Paso | City | TX | 3255 | 3287 | 3405 |
|---|
| 21 | 21 | 17762 | Detroit | City | MI | 3550 | 3413 | 3358 |
|---|
| 22 | 22 | 11093 | Denver | City | CO | 2486 | 2404 | 2588 |
|---|
| 23 | 23 | 16037 | Seattle | City | WA | 1514 | 1569 | 1709 |
|---|
| 24 | 24 | 32811 | Memphis | City | TN | 3024 | 2867 | 2986 |
|---|
| 25 | 25 | 44269 | Boston | City | MA | 1193 | 1287 | 1570 |
|---|
| 26 | 26 | 41568 | Washington | City | DC | 1362 | 1339 | 1418 |
|---|
| 27 | 27 | 13373 | Portland | City | OR | 2133 | 2158 | 2220 |
|---|
| 28 | 28 | 6118 | Nashville | City | TN | 4285 | 4280 | 4448 |
|---|
| 29 | 29 | 20288 | Sacramento | City | CA | 905 | 938 | 990 |
|---|
| 30 | 30 | 3523 | Baltimore | City | MD | 2907 | 2894 | 3026 |
|---|
| ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
|---|
"
],
"text/latex": [
"\\begin{tabular}{r|ccccccccc}\n",
"\t& SizeRank & RegionID & RegionName & RegionType & StateName & 2013-01 & 2013-02 & 2013-03 & \\\\\n",
"\t\\hline\n",
"\t& Any & Any & Any & Any & Any & Any & Any & Any & \\\\\n",
"\t\\hline\n",
"\t1 & 1 & 6181 & New York & City & NY & 28904 & 28155 & 30596 & $\\dots$ \\\\\n",
"\t2 & 2 & 12447 & Los Angeles & City & CA & 6431 & 6613 & 6467 & $\\dots$ \\\\\n",
"\t3 & 3 & 39051 & Houston & City & TX & 11696 & 11737 & 12291 & $\\dots$ \\\\\n",
"\t4 & 4 & 17426 & Chicago & City & IL & 9523 & 9609 & 9772 & $\\dots$ \\\\\n",
"\t5 & 5 & 6915 & San Antonio & City & TX & 7223 & 7170 & 7438 & $\\dots$ \\\\\n",
"\t6 & 6 & 13271 & Philadelphia & City & PA & 7505 & 7266 & 7578 & $\\dots$ \\\\\n",
"\t7 & 7 & 40326 & Phoenix & City & AZ & 6232 & 5720 & 5872 & $\\dots$ \\\\\n",
"\t8 & 8 & 18959 & Las Vegas & City & NV & 7027 & 6218 & 6199 & $\\dots$ \\\\\n",
"\t9 & 9 & 54296 & San Diego & City & CA & 4121 & 3844 & 3932 & $\\dots$ \\\\\n",
"\t10 & 10 & 38128 & Dallas & City & TX & 4332 & 4395 & 4568 & $\\dots$ \\\\\n",
"\t11 & 11 & 10221 & Austin & City & TX & 2345 & 2230 & 2301 & $\\dots$ \\\\\n",
"\t12 & 12 & 33839 & San Jose & City & CA & \\emph{missing} & \\emph{missing} & \\emph{missing} & $\\dots$ \\\\\n",
"\t13 & 13 & 25290 & Jacksonville & City & FL & 4517 & 4495 & 4481 & $\\dots$ \\\\\n",
"\t14 & 14 & 24043 & Charlotte & City & NC & 4550 & 4451 & 4812 & $\\dots$ \\\\\n",
"\t15 & 15 & 18172 & Fort Worth & City & TX & 3709 & 3738 & 3703 & $\\dots$ \\\\\n",
"\t16 & 16 & 7481 & Tucson & City & AZ & 4422 & 4355 & 4376 & $\\dots$ \\\\\n",
"\t17 & 17 & 10920 & Columbus & City & OH & 3873 & 3849 & 4099 & $\\dots$ \\\\\n",
"\t18 & 18 & 12455 & Louisville & City & KY & 3517 & 3355 & 3567 & $\\dots$ \\\\\n",
"\t19 & 19 & 13121 & Orlando & City & FL & 2821 & 2781 & 2711 & $\\dots$ \\\\\n",
"\t20 & 20 & 17933 & El Paso & City & TX & 3255 & 3287 & 3405 & $\\dots$ \\\\\n",
"\t21 & 21 & 17762 & Detroit & City & MI & 3550 & 3413 & 3358 & $\\dots$ \\\\\n",
"\t22 & 22 & 11093 & Denver & City & CO & 2486 & 2404 & 2588 & $\\dots$ \\\\\n",
"\t23 & 23 & 16037 & Seattle & City & WA & 1514 & 1569 & 1709 & $\\dots$ \\\\\n",
"\t24 & 24 & 32811 & Memphis & City & TN & 3024 & 2867 & 2986 & $\\dots$ \\\\\n",
"\t25 & 25 & 44269 & Boston & City & MA & 1193 & 1287 & 1570 & $\\dots$ \\\\\n",
"\t26 & 26 & 41568 & Washington & City & DC & 1362 & 1339 & 1418 & $\\dots$ \\\\\n",
"\t27 & 27 & 13373 & Portland & City & OR & 2133 & 2158 & 2220 & $\\dots$ \\\\\n",
"\t28 & 28 & 6118 & Nashville & City & TN & 4285 & 4280 & 4448 & $\\dots$ \\\\\n",
"\t29 & 29 & 20288 & Sacramento & City & CA & 905 & 938 & 990 & $\\dots$ \\\\\n",
"\t30 & 30 & 3523 & Baltimore & City & MD & 2907 & 2894 & 3026 & $\\dots$ \\\\\n",
"\t$\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m8347×91 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m SizeRank \u001b[0m\u001b[1m RegionID \u001b[0m\u001b[1m RegionName \u001b[0m\u001b[1m RegionType \u001b[0m\u001b[1m StateName \u001b[0m\u001b[1m 2013-\u001b[0m ⋯\n",
"\u001b[1m \u001b[0m│\u001b[90m Any \u001b[0m\u001b[90m Any \u001b[0m\u001b[90m Any \u001b[0m\u001b[90m Any \u001b[0m\u001b[90m Any \u001b[0m\u001b[90m Any \u001b[0m ⋯\n",
"──────┼─────────────────────────────────────────────────────────────────────────\n",
" 1 │ 1 6181 New York City NY 28904 ⋯\n",
" 2 │ 2 12447 Los Angeles City CA 6431\n",
" 3 │ 3 39051 Houston City TX 11696\n",
" 4 │ 4 17426 Chicago City IL 9523\n",
" 5 │ 5 6915 San Antonio City TX 7223 ⋯\n",
" 6 │ 6 13271 Philadelphia City PA 7505\n",
" 7 │ 7 40326 Phoenix City AZ 6232\n",
" 8 │ 8 18959 Las Vegas City NV 7027\n",
" 9 │ 9 54296 San Diego City CA 4121 ⋯\n",
" 10 │ 10 38128 Dallas City TX 4332\n",
" 11 │ 11 10221 Austin City TX 2345\n",
" ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱\n",
" 8338 │ 7335 15309 Evans Mills City NY \u001b[90m missi\u001b[0m\n",
" 8339 │ 7335 15829 Point Roberts City WA 24 ⋯\n",
" 8340 │ 7335 25413 Kingston City GA \u001b[90m missi\u001b[0m\n",
" 8341 │ 7335 28637 Everglades City FL 26\n",
" 8342 │ 7335 29921 Ennis City MT 32\n",
" 8343 │ 7335 32151 Ingleside on the Bay City TX \u001b[90m missi\u001b[0m ⋯\n",
" 8344 │ 7335 38337 El Paso City IL \u001b[90m missi\u001b[0m\n",
" 8345 │ 7335 46631 Mount Charleston City NV \u001b[90m missi\u001b[0m\n",
" 8346 │ 7335 52665 Jamaica Beach City TX 58\n",
" 8347 │ 7335 54635 Surfside Beach City TX 72 ⋯\n",
"\u001b[36m 86 columns and 8326 rows omitted\u001b[0m"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sale_counts = R[\"Sale_counts_city\"][:]\n",
"df_sale_counts = DataFrame(sale_counts[2:end,:],Symbol.(sale_counts[1,:]))\n",
"\n",
"monthly_listings = R[\"MonthlyListings_City\"][:]\n",
"df_monthly_listings = DataFrame(monthly_listings[2:end,:],Symbol.(monthly_listings[1,:]))"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" | RegionID | sales |
|---|
| Any | Any |
|---|
28,759 rows × 2 columns
| 1 | 6181 | 4054 |
|---|
| 2 | 12447 | 1522 |
|---|
| 3 | 39051 | 2682 |
|---|
| 4 | 17426 | 2100 |
|---|
| 5 | 6915 | 1626 |
|---|
| 6 | 13271 | 1620 |
|---|
| 7 | 40326 | 2325 |
|---|
| 8 | 18959 | 2547 |
|---|
| 9 | 54296 | missing |
|---|
| 10 | 38128 | 1292 |
|---|
| 11 | 10221 | 1023 |
|---|
| 12 | 33839 | 439 |
|---|
| 13 | 25290 | missing |
|---|
| 14 | 32149 | 1443 |
|---|
| 15 | 20330 | 291 |
|---|
| 16 | 24043 | 1439 |
|---|
| 17 | 18172 | 1059 |
|---|
| 18 | 7481 | 870 |
|---|
| 19 | 10920 | 895 |
|---|
| 20 | 12455 | 972 |
|---|
| 21 | 13121 | 726 |
|---|
| 22 | 17933 | 465 |
|---|
| 23 | 17762 | missing |
|---|
| 24 | 11093 | 1198 |
|---|
| 25 | 16037 | 482 |
|---|
| 26 | 32811 | 898 |
|---|
| 27 | 44269 | 147 |
|---|
| 28 | 41568 | 845 |
|---|
| 29 | 13373 | 642 |
|---|
| 30 | 6118 | 1107 |
|---|
| ⋮ | ⋮ | ⋮ |
|---|
"
],
"text/latex": [
"\\begin{tabular}{r|cc}\n",
"\t& RegionID & sales\\\\\n",
"\t\\hline\n",
"\t& Any & Any\\\\\n",
"\t\\hline\n",
"\t1 & 6181 & 4054 \\\\\n",
"\t2 & 12447 & 1522 \\\\\n",
"\t3 & 39051 & 2682 \\\\\n",
"\t4 & 17426 & 2100 \\\\\n",
"\t5 & 6915 & 1626 \\\\\n",
"\t6 & 13271 & 1620 \\\\\n",
"\t7 & 40326 & 2325 \\\\\n",
"\t8 & 18959 & 2547 \\\\\n",
"\t9 & 54296 & \\emph{missing} \\\\\n",
"\t10 & 38128 & 1292 \\\\\n",
"\t11 & 10221 & 1023 \\\\\n",
"\t12 & 33839 & 439 \\\\\n",
"\t13 & 25290 & \\emph{missing} \\\\\n",
"\t14 & 32149 & 1443 \\\\\n",
"\t15 & 20330 & 291 \\\\\n",
"\t16 & 24043 & 1439 \\\\\n",
"\t17 & 18172 & 1059 \\\\\n",
"\t18 & 7481 & 870 \\\\\n",
"\t19 & 10920 & 895 \\\\\n",
"\t20 & 12455 & 972 \\\\\n",
"\t21 & 13121 & 726 \\\\\n",
"\t22 & 17933 & 465 \\\\\n",
"\t23 & 17762 & \\emph{missing} \\\\\n",
"\t24 & 11093 & 1198 \\\\\n",
"\t25 & 16037 & 482 \\\\\n",
"\t26 & 32811 & 898 \\\\\n",
"\t27 & 44269 & 147 \\\\\n",
"\t28 & 41568 & 845 \\\\\n",
"\t29 & 13373 & 642 \\\\\n",
"\t30 & 6118 & 1107 \\\\\n",
"\t$\\dots$ & $\\dots$ & $\\dots$ \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m28759×2 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m RegionID \u001b[0m\u001b[1m sales \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m Any \u001b[0m\u001b[90m Any \u001b[0m\n",
"───────┼───────────────────\n",
" 1 │ 6181 4054\n",
" 2 │ 12447 1522\n",
" 3 │ 39051 2682\n",
" 4 │ 17426 2100\n",
" 5 │ 6915 1626\n",
" 6 │ 13271 1620\n",
" 7 │ 40326 2325\n",
" 8 │ 18959 2547\n",
" 9 │ 54296 \u001b[90m missing \u001b[0m\n",
" 10 │ 38128 1292\n",
" 11 │ 10221 1023\n",
" ⋮ │ ⋮ ⋮\n",
" 28750 │ 396952 \u001b[90m missing \u001b[0m\n",
" 28751 │ 397236 \u001b[90m missing \u001b[0m\n",
" 28752 │ 398030 \u001b[90m missing \u001b[0m\n",
" 28753 │ 398104 \u001b[90m missing \u001b[0m\n",
" 28754 │ 398357 \u001b[90m missing \u001b[0m\n",
" 28755 │ 398712 \u001b[90m missing \u001b[0m\n",
" 28756 │ 398716 2\n",
" 28757 │ 399081 0\n",
" 28758 │ 737789 \u001b[90m missing \u001b[0m\n",
" 28759 │ 760882 0\n",
"\u001b[36m 28738 rows omitted\u001b[0m"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"monthly_listings_2020_02 = df_monthly_listings[!,[1,2,3,4,5,end]]\n",
"rename!(monthly_listings_2020_02, Symbol(\"2020-02\") .=> Symbol(\"listings\"))\n",
"\n",
"sale_counts_2020_02 = df_sale_counts[!,[1,end]]\n",
"rename!(sale_counts_2020_02, Symbol(\"2020-02\") .=> Symbol(\"sales\"))"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"ename": "LoadError",
"evalue": "UndefVarError: Feb2020data not defined",
"output_type": "error",
"traceback": [
"UndefVarError: Feb2020data not defined",
"",
"Stacktrace:",
" [1] top-level scope",
" @ :0",
" [2] eval",
" @ ./boot.jl:360 [inlined]",
" [3] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)",
" @ Base ./loading.jl:1094"
]
}
],
"source": [
"Feb2020data"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"10-element Vector{Plots.Plot}:\n",
" #undef\n",
" #undef\n",
" #undef\n",
" #undef\n",
" #undef\n",
" #undef\n",
" #undef\n",
" #undef\n",
" #undef\n",
" #undef"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Feb2020data = innerjoin(monthly_listings_2020_02,sale_counts_2020_02,on=:RegionID) #, type=\"outer\")\n",
"dropmissing!(Feb2020data)\n",
"sales = Feb2020data[!,:sales]\n",
"# prices = Feb2020data[!,:price]\n",
"counts = Feb2020data[!,:listings]\n",
"using DataStructures\n",
"states = Feb2020data[!,:StateName]\n",
"C = counter(states)\n",
"C.map\n",
"countvals = values(C.map)\n",
"topstates = sortperm(collect(countvals),rev=true)[1:10]\n",
"states_of_interest = collect(keys(C.map))[topstates]\n",
"all_plots = Array{Plots.Plot}(undef,10)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(si, coef(ols)) = (\"CA\", [0.29595375979515304])\n",
"(si, coef(ols)) = (\"FL\", [0.16693529057344902])\n",
"(si, coef(ols)) = (\"IL\", [0.22291703276169347])\n",
"(si, coef(ols)) = (\"NJ\", [0.25556391864492345])\n",
"(si, coef(ols)) = (\"MI\", [0.2925436820147375])\n",
"(si, coef(ols)) = (\"TX\", [0.24732835944836878])\n",
"(si, coef(ols)) = (\"PA\", [0.310066636803275])\n",
"(si, coef(ols)) = (\"OH\", [0.4569949754409864])\n",
"(si, coef(ols)) = (\"NC\", [0.4800747758857476])\n",
"(si, coef(ols)) = (\"NY\", [0.19151984869233082])\n"
]
},
{
"data": {
"image/svg+xml": [
"\n",
"