Skip to content

Commit

Permalink
#3 Run additional regression with subset years greater or equal to 1960
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiqiYang2022 committed Jul 19, 2023
1 parent 72c5e9a commit 4b35c3f
Show file tree
Hide file tree
Showing 25 changed files with 1,770 additions and 1,323 deletions.
9 changes: 9 additions & 0 deletions analysis/code/analyze_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ def main():
with open('output/regression.csv', 'w') as f:
f.write('<tab:regression>' + '\n')
formatted.to_csv(f, sep = '\t', index = False, header = False)

# Run the regression on subset of years greater or equal to 1960
df_ge1960 = df[df['year'] >= 1960].copy()
fit_ge1960 = run_regression(df_ge1960)
formatted_ge1960 = format_model(fit_ge1960)

with open('output/regression_ge1960.csv', 'w') as f:
f.write('<tab:regression_ge1960>' + '\n')
formatted_ge1960.to_csv(f, sep = '\t', index = False, header = False)

def import_data():
df = pd.read_csv('input/data_cleaned.csv')
Expand Down
7 changes: 5 additions & 2 deletions analysis/log/make.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------------
Makelog started: 2023-07-18 13:47:56
Makelog started: 2023-07-18 17:26:32
Working directory: /Users/shiqiyang/Documents/github_folders/replication_download/template/analysis
--------------------------------------------------------------------------------
Input links successfully created!
Expand All @@ -8,11 +8,14 @@ Source logs successfully written!
Version logs successfully written!
Executing command: `python "/Users/shiqiyang/Documents/github_folders/replication_download/template/analysis/code/analyze_data.py" `
/usr/local/Caskroom/miniconda/base/envs/template/lib/python3.11/site-packages/linearmodels/panel/model.py:1214: MissingValueWarning:
Inputs contain missing values. Dropping rows with missing observations.
super().__init__(dependent, exog, weights=weights, check_rank=check_rank)
/usr/local/Caskroom/miniconda/base/envs/template/lib/python3.11/site-packages/linearmodels/panel/model.py:1214: MissingValueWarning:
Inputs contain missing values. Dropping rows with missing observations.
super().__init__(dependent, exog, weights=weights, check_rank=check_rank)

Output logs successfully written!
--------------------------------------------------------------------------------
Makelog ended: 2023-07-18 13:48:04
Makelog ended: 2023-07-18 17:26:38
Working directory: /Users/shiqiyang/Documents/github_folders/replication_download/template/analysis
--------------------------------------------------------------------------------
3 changes: 2 additions & 1 deletion analysis/log/output_stats.log
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
file name | last modified | file size
/Users/shiqiyang/Documents/github_folders/replication_download/template/analysis/output/regression.csv | 2023-07-18 20:48:04 | 58
/Users/shiqiyang/Documents/github_folders/replication_download/template/analysis/output/regression_ge1960.csv | 2023-07-19 00:26:38 | 64
/Users/shiqiyang/Documents/github_folders/replication_download/template/analysis/output/regression.csv | 2023-07-19 00:26:38 | 58
1,300 changes: 650 additions & 650 deletions analysis/log/source_stats.log

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion analysis/log/versions.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------------
Versions log started: 2023-07-18 13:47:58
Versions log started: 2023-07-18 17:26:34
--------------------------------------------------------------------------------
# packages in environment at /usr/local/Caskroom/miniconda/base/envs/template:
#
Expand Down
2 changes: 2 additions & 0 deletions analysis/output/regression_ge1960.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<tab:regression_ge1960>
5037.693913328167 9.597032137833713 0.0
4 changes: 2 additions & 2 deletions data/log/make.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------------
Makelog started: 2023-07-18 13:47:47
Makelog started: 2023-07-18 17:26:26
Working directory: /Users/shiqiyang/Documents/github_folders/replication_download/template/data
--------------------------------------------------------------------------------
Input links successfully created!
Expand All @@ -19,6 +19,6 @@ WARNING! Certain files tracked by git exceed the config size limit (0.5 MB). See
/Users/shiqiyang/Documents/github_folders/replication_download/template/data/output/data_merged.csv
/Users/shiqiyang/Documents/github_folders/replication_download/template/data/output/data_cleaned.csv
--------------------------------------------------------------------------------
Makelog ended: 2023-07-18 13:47:55
Makelog ended: 2023-07-18 17:26:31
Working directory: /Users/shiqiyang/Documents/github_folders/replication_download/template/data
--------------------------------------------------------------------------------
6 changes: 3 additions & 3 deletions data/log/output_stats.log
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file name | last modified | file size
/Users/shiqiyang/Documents/github_folders/replication_download/template/data/output/chips_sold.pdf | 2023-07-18 20:47:55 | 6708
/Users/shiqiyang/Documents/github_folders/replication_download/template/data/output/data_cleaned.csv | 2023-07-18 20:47:55 | 10260923
/Users/shiqiyang/Documents/github_folders/replication_download/template/data/output/data_merged.csv | 2023-07-18 20:47:53 | 10290907
/Users/shiqiyang/Documents/github_folders/replication_download/template/data/output/data_merged.csv | 2023-07-19 00:26:29 | 10290907
/Users/shiqiyang/Documents/github_folders/replication_download/template/data/output/data_cleaned.csv | 2023-07-19 00:26:31 | 10260923
/Users/shiqiyang/Documents/github_folders/replication_download/template/data/output/chips_sold.pdf | 2023-07-19 00:26:31 | 6708
Loading

0 comments on commit 4b35c3f

Please sign in to comment.