8000 Fixed URL Error · QuantEcon/lecture-python-intro@1c432f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1c432f8

Browse files
committed
Fixed URL Error
1 parent 2bf1fdd commit 1c432f8

File tree

1 file changed

+12
-10
lines changed
< 8000 span class="prc-TooltipV2-Tooltip-cYMVY" data-direction="s" aria-hidden="true" id=":R3t5dab:">Filter options

1 file changed

+12
-10
lines changed

lectures/simple_linear_regression.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.14.4
7+
jupytext_version: 1.16.1
88
kernelspec:
99
display_name: Python 3 (ipykernel)
1010
language: python
@@ -17,6 +17,8 @@ kernelspec:
1717
import numpy as np
1818
import pandas as pd
1919
import matplotlib.pyplot as plt
20+
import pyodide_http
21+
pyodide_http.patch_all()
2022
```
2123

2224
The simple regression model estimates the relationship between two variables $x_i$ and $y_i$
@@ -60,7 +62,7 @@ We can use a scatter plot of the data to see the relationship between $y_i$ (ice
6062
---
6163
mystnb:
6264
figure:
63-
caption: "Scatter plot"
65+
caption: Scatter plot
6466
name: sales-v-temp1
6567
---
6668
ax = df.plot(
@@ -92,7 +94,7 @@ df['Y_hat'] = α + β * df['X']
9294
---
9395
mystnb:
9496
figure:
95-
caption: "Scatter plot with a line of fit"
97+
caption: Scatter plot with a line of fit
9698
name: sales-v-temp2
9799
---
98100
fig, ax = plt.subplots()
@@ -114,7 +116,7 @@ df['Y_hat'] = α + β * df['X']
114116
---
115117
mystnb:
116118
figure:
117-
caption: "Scatter plot with a line of fit #2"
119+
caption: 'Scatter plot with a line of fit #2'
118120
name: sales-v-temp3
119121
---
120122
fig, ax = plt.subplots()
@@ -132,7 +134,7 @@ df['Y_hat'] = α + β * df['X']
132134
---
133135
mystnb:
134136
figure:
135-
caption: "Scatter plot with a line of fit #3"
137+
caption: 'Scatter plot with a line of fit #3'
136138
name: sales-v-temp4
137139
---
138140
fig, ax = plt.subplots()
@@ -164,7 +166,7 @@ df
164166
---
165167
mystnb:
166168
figure:
167-
caption: "Plot of the residuals"
169+
caption: Plot of the residuals
168170
name: plt-residuals
169171
---
170172
fig, ax = plt.subplots()
@@ -213,7 +215,7 @@ Plotting the error
213215
---
214216
mystnb:
215217
figure:
216-
caption: "Plotting the error"
218+
caption: Plotting the error
217219
name: plt-errors
218220
---
219221
ax = pd.Series(errors).plot(xlabel='β', ylabel='error')
@@ -234,7 +236,7 @@ Plotting the error
234236
---
235237
mystnb:
236238
figure:
237-
caption: "Plotting the error (2)"
239+
caption: Plotting the error (2)
238240
name: plt-errors-2
239241
---
240242
ax = pd.Series(errors).plot(xlabel='α', ylabel='error')
@@ -371,7 +373,7 @@ Now we can plot the OLS solution
371373
---
372374
mystnb:
373375
figure:
374-
caption: "OLS line of best fit"
376+
caption: OLS line of best fit
375377
name: plt-ols
376378
---
377379
df['Y_hat'] = α + β * df['X']
@@ -413,7 +415,7 @@ You can download {download}`a copy of the data here <https://github.com/QuantEco
413415
**Q3:** Use `pandas` to import the `csv` formatted data and plot a few different countries of interest
414416
415417
```{code-cell} ipython3
416-
data_url = "https://github.com/QuantEcon/lecture-python-intro/raw/main/lectures/_static/lecture_specific/simple_linear_regression/life-expectancy-vs-gdp-per-capita.csv"
418+
data_url = "https://raw.githubusercontent.com/QuantEcon/lecture-python-intro/main/lectures/_static/lecture_specific/simple_linear_regression/life-expectancy-vs-gdp-per-capita.csv"
417419
df = pd.read_csv(data_url, nrows=10)
418420
```
419421

0 commit comments

Comments
 (0)
0