Publications by Arvind Sharma
Logistic_regression_implementation
0.1 Data Lets load some data. Dependent variable am is binary: Transmission (0 = automatic, 1 = manual). ?mtcars # see variables remove(list = ls()) #view first six rows of mtcars dataset head(mtcars) ## mpg cyl disp hp drat wt qsec vs am gear carb ## Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 ## ...
1198 sym R (6966 sym/24 pcs)
Box_Cox
Key Point: The log transformation, while may have a nice interpretation, may not always be the best. You can investigated Box-Cox power transformations to help. 1 Setup Import data, basic summary stats. library(car) ## Loading required package: carData getwd() # current wd ## [1] "/Users/arvindsharma/Library/CloudStorage/Dropbox/WCAS/Econometrics/...
1738 sym R (3382 sym/24 pcs) 7 img
HW1_solution
1 Setup 1.1 Empty variables and functions in the environment tab/window First, empty the environment so that we can uplaod the clean data. # Clear the workspace rm(list = ls()) # Clear environment -remove all files from your workspace gc() # Clear unused memory ## used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) ## Ncells...
14824 sym R (45453 sym/102 pcs) 21 img
Heteroskedasticty_white
1 Estimate a Multivariate Regression Should have atleast 3 independent variables. 1.1 Data Choose your data. I will continue with the data for my OLS point estimates in OLS_matrixVSlm in W1 remove(list=ls()) # install.packages("MASS") library(MASS) help(Boston) str(Boston) # 506 rows and 14 columns. ## 'data.frame': 506 obs. of 14 variabl...
7129 sym R (11337 sym/57 pcs) 2 img
Heteroskedasticty
1 Estimate a Multivariate Regression Should have atleast 2 independent variables. 1.1 Data Choose your data. I will continue with the data for my OLS point estimates in OLS_matrixVSlm in W1 remove(list=ls()) # install.packages("MASS") library(MASS) help(Boston) str(Boston) # 506 rows and 14 columns. ## 'data.frame': 506 obs. of 14 variabl...
5988 sym R (13451 sym/66 pcs) 2 img
ConfusionMatrix
1 How to get Classification Confusion Matrix? Logistic Regression is a classification type supervised learning model. Logistic Regression is used when the independent variable x, is either a continuous or categorical variable and the dependent variable (y) is a categorical variable. Confusion matrix: Confusion matrix categorizes the actual data w.r...
1763 sym R (2327 sym/18 pcs)
HW1_template_hints
Please note that option knitr::opts_knit$set(root.dir = “YOUR WORKING DIRECTORY”) is only required if your .Rmd file is in a different folder than you raw data, like in my case. Open up the .Rmd file and see your yourself below - Knitr Explanation You can modify it, or you can simply create a new .Rmd file on your machine and copy over the rele...
2971 sym R (25951 sym/52 pcs) 10 img
DataTypes
1 Cross Section Data 1.1 Infidelity data Variables Description # install.packages("AER") library("AER") ## Loading required package: car ## Loading required package: carData ## Loading required package: lmtest ## Loading required package: zoo ## ## Attaching package: 'zoo' ## The following objects are masked from 'package:base': ## ## as.Dat...
494 sym R (11151 sym/35 pcs) 3 img
OLS_matrixVSlm
1 Introduction One of the very first learning algorithms that you’ll encounter when studying data science and machine learning is least squares linear regression. Linear regression is one of the easiest learning algorithms to understand; it’s suitable for a wide array of problems, and is already implemented in many programming languages. Most u...
4943 sym R (14150 sym/25 pcs)
Math Review
1 Theory Either look at the math camp notes, or on some simplified online blogs. Inverse of a matrix can only be calculated/is defined only for a square matrix. Furthermore, not all squares matrices have an inverse - it requires linear independence of all columns and rows i.e. the vector or data is not redundant in the matrix. A simpler way to see...
1395 sym