Publications by Arvind Sharma
hw1_suggested_solution
1 Setup 1.1 Empty environment (data, functions) and graphical (plots) window First, empty the environment and then import the raw data. # Clear the environment rm(list = ls()) # Clear unused memory gc() ## used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) ## Ncells 552779 29.6 1229248 65.7 NA 700240 37.4 ## Vcells 103383...
15101 sym R (44178 sym/104 pcs) 23 img
Homework2_template
This file is still written for a coder/analyst, and you will have to polish it (change text and hide chunks) to make it an effective client ready report. Play around with code chunk options like suppressing warnings or output. 1 Setup 1.1 Working Directory and Data Empty variables and functions in the environment tab/window, set working directory...
6871 sym R (23375 sym/53 pcs) 10 img
ConfusionMatrix
Table of contents How to get Classification Confusion Matrix? Example Step 1 - Install necessary libraries Step 2 - Generate random data Step 3 - Create a Confusion Matrix by hand Step 4 - Confusion matrix using the ‘caret’ package Confusion Matrix How to get Classification Confusion Matrix? Logistic Regression is a classification type su...
3356 sym R (3880 sym/40 pcs) 1 img
Logistic_regression_implementation
Table of contents Data OLS In Sample Fit / Training Data Logistic Regression Interpretation of Output predict.glm Notes on convert probabilities into (binary) outcomes In Sample Fit / Training Data Out of Sample Fit / Testing Data Probit Regression Useful Readings Logit Implementation Author Arvind Sharma remove(list = ls()) library(s...
12197 sym 5 img
Fixed Effects
Table of contents Introduction Setup Data Create dependent variable. Summary Statistics Data Dictionary OLS Without FE Omitted Variables Model: OLS with Dummy Variables i.e. With FE Model: Demeaned Regression Model: Fixed Effects FE limitations Two Way FE Implementation Unbalanced Panel Creating an unbalanced data Create the CI Random...
10522 sym Python (83318 sym/42 pcs) 5 img
Diff_in_Diff_assumptions
Table of contents EXAMPLE 1: Estimating Diff-in-Diff Getting sample data. Create a dummy variable to identify the group exposed to the treatment. Interaction Term Estimating the DID estimator Estimating the DID estimator EXAMPLE 2 Identifying Assumptions Parallel Trends Assumption: No Spillover Effects: No Other Contemporaneous Events: Sufficie...
4335 sym
Residual_Analysis
Table of contents Linear Regression Specification Residual Analysis Plot of Fitted vs Residual Creating Manually Normal QQ plot of the residuals Creating Manually Scale Location Standardized residuals of a linear regression model Creating Manually Residual versus leverage chart Creating Manually Linear Regression: Residual Analysis # Cle...
11256 sym Python (8284 sym/30 pcs) 11 img
Residual_Plots_MARR
Table of contents Raw Data Linear Regressions Run the linear regressions Present the linear regressions Residual Analysis Model 1 Model 2 Model 3 Model 4 Presentation Residual Analysis: Valid and Invalid Regression Models - Anscombe’s Four Data Sets # Clear the workspace rm(list = ls()) # Clear all files from your environment # gc() ...
1032 sym Python (7480 sym/34 pcs) 24 img
OVB_and_Modelling_Nonlinear_Rel
Table of contents OVB EXAMPLE: Gender Discrimination in Wages Data Full Regression Short Regression Check for OVB Condition I. X is correlated with the omitted variable. Condition II. The omitted variable is a determinant of the dependent variable Y. Predicting Biased Coefficient Value EXAMPLE: Test Scores and Student Teacher Ratio English La...
9590 sym Python (13087 sym/61 pcs) 6 img 1 tbl
Diff_in_Diff_Discussion
Difference in Difference Dr. Arvind Sharma Introduction Difference-in-differences (DiD) is a statistical technique commonly used in Econometrics and social sciences to estimate the causal effect of an intervention or policy change (aka “treatment”) on an outcome of interest Origins of Diff-in-Diff: John Snow’s Cholera1 Hypothesis (water ...
6681 sym 15 img 1 tbl