R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

#install.packages("readr")
library(readr)
data <- read_csv("Stackoverflow2.csv")
## Warning: One or more parsing issues, call `problems()` on your data frame for details,
## e.g.:
##   dat <- vroom(...)
##   problems(dat)
## Rows: 89184 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (5): Dev_type, YearsCodePro, edlevel, country, CompTotal
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
summary(lm(CompTotal~ factor(Dev_type) + factor(country) + factor(YearsCodePro) + factor(edlevel), data = data))
## 
## Call:
## lm(formula = CompTotal ~ factor(Dev_type) + factor(country) + 
##     factor(YearsCodePro) + factor(edlevel), data = data)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.609e+17 -8.008e+15  3.248e+15  1.873e+16  9.996e+20 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            -4.128e+14  9.129e+16  -0.005    0.996    
## factor(Dev_type)1      -1.221e+16  6.387e+16  -0.191    0.848    
## factor(Dev_type)2       5.998e+16  5.278e+16   1.137    0.256    
## factor(Dev_type)3      -1.056e+16  4.834e+16  -0.218    0.827    
## factor(Dev_type)4      -6.445e+15  4.585e+16  -0.141    0.888    
## factor(country)1       -1.684e+16  2.818e+16  -0.597    0.550    
## factor(YearsCodePro)1  -5.960e+15  5.917e+16  -0.101    0.920    
## factor(YearsCodePro)2  -7.265e+15  5.938e+16  -0.122    0.903    
## factor(YearsCodePro)3  -7.036e+15  5.974e+16  -0.118    0.906    
## factor(YearsCodePro)4  -7.791e+15  6.207e+16  -0.126    0.900    
## factor(YearsCodePro)5  -6.901e+15  5.800e+16  -0.119    0.905    
## factor(YearsCodePro)6  -6.352e+15  6.419e+16  -0.099    0.921    
## factor(YearsCodePro)7  -6.974e+15  6.516e+16  -0.107    0.915    
## factor(YearsCodePro)8   2.824e+17  6.543e+16   4.316 1.59e-05 ***
## factor(YearsCodePro)9  -5.814e+15  7.925e+16  -0.073    0.942    
## factor(YearsCodePro)10 -4.822e+15  5.896e+16  -0.082    0.935    
## factor(YearsCodePro)11 -6.304e+15  8.134e+16  -0.077    0.938    
## factor(YearsCodePro)12 -4.027e+15  7.555e+16  -0.053    0.957    
## factor(YearsCodePro)13 -5.001e+15  8.767e+16  -0.057    0.955    
## factor(YearsCodePro)14 -4.442e+15  9.995e+16  -0.044    0.965    
## factor(YearsCodePro)15 -3.269e+15  7.107e+16  -0.046    0.963    
## factor(YearsCodePro)16 -4.638e+15  9.917e+16  -0.047    0.963    
## factor(YearsCodePro)17 -4.337e+15  1.041e+17  -0.042    0.967    
## factor(YearsCodePro)18 -4.324e+15  1.015e+17  -0.043    0.966    
## factor(YearsCodePro)19 -3.033e+15  1.355e+17  -0.022    0.982    
## factor(YearsCodePro)20 -2.882e+14  7.768e+16  -0.004    0.997    
## factor(YearsCodePro)21 -4.773e+15  1.446e+17  -0.033    0.974    
## factor(YearsCodePro)22 -2.173e+15  1.196e+17  -0.018    0.986    
## factor(YearsCodePro)23 -9.128e+14  1.054e+17  -0.009    0.993    
## factor(YearsCodePro)24 -1.619e+15  1.318e+17  -0.012    0.990    
## factor(YearsCodePro)25  6.726e+14  9.346e+16   0.007    0.994    
## factor(YearsCodePro)26 -5.494e+14  1.553e+17  -0.004    0.997    
## factor(YearsCodePro)27 -2.076e+15  1.546e+17  -0.013    0.989    
## factor(YearsCodePro)28  2.712e+15  1.671e+17   0.016    0.987    
## factor(YearsCodePro)29 -1.545e+15  2.297e+17  -0.007    0.995    
## factor(YearsCodePro)30  3.817e+15  1.146e+17   0.033    0.973    
## factor(YearsCodePro)31  1.424e+15  2.471e+17   0.006    0.995    
## factor(YearsCodePro)32 -1.922e+15  1.983e+17  -0.010    0.992    
## factor(YearsCodePro)33  3.479e+15  2.086e+17   0.017    0.987    
## factor(YearsCodePro)34  1.399e+15  2.538e+17   0.006    0.996    
## factor(YearsCodePro)35  4.697e+15  1.589e+17   0.030    0.976    
## factor(YearsCodePro)36 -5.643e+13  2.389e+17   0.000    1.000    
## factor(YearsCodePro)37  4.298e+15  2.753e+17   0.016    0.988    
## factor(YearsCodePro)38  5.968e+15  2.636e+17   0.023    0.982    
## factor(YearsCodePro)39  3.073e+15  3.382e+17   0.009    0.993    
## factor(YearsCodePro)40  5.450e+15  1.871e+17   0.029    0.977    
## factor(YearsCodePro)41  3.524e+15  3.782e+17   0.009    0.993    
## factor(YearsCodePro)42  9.733e+15  3.736e+17   0.026    0.979    
## factor(YearsCodePro)43  6.801e+15  4.105e+17   0.017    0.987    
## factor(YearsCodePro)44  5.825e+15  5.181e+17   0.011    0.991    
## factor(YearsCodePro)45  1.240e+16  3.331e+17   0.037    0.970    
## factor(YearsCodePro)46  4.544e+15  5.839e+17   0.008    0.994    
## factor(YearsCodePro)47  6.229e+15  6.846e+17   0.009    0.993    
## factor(YearsCodePro)48  1.607e+16  6.125e+17   0.026    0.979    
## factor(YearsCodePro)49  9.379e+15  8.961e+17   0.010    0.992    
## factor(YearsCodePro)50  8.964e+15  6.847e+17   0.013    0.990    
## factor(edlevel)1        4.128e+14  1.327e+17   0.003    0.998    
## factor(edlevel)2        3.383e+15  1.171e+17   0.029    0.977    
## factor(edlevel)3        2.910e+14  9.455e+16   0.003    0.998    
## factor(edlevel)4       -2.835e+15  9.294e+16  -0.031    0.976    
## factor(edlevel)5       -4.187e+15  1.083e+17  -0.039    0.969    
## factor(edlevel)6        1.889e+16  8.981e+16   0.210    0.833    
## factor(edlevel)7       -1.237e+16  9.133e+16  -0.135    0.892    
## factor(edlevel)8       -5.747e+15  1.036e+17  -0.055    0.956    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.351e+18 on 89037 degrees of freedom
##   (83 observations deleted due to missingness)
## Multiple R-squared:  0.0003497,  Adjusted R-squared:  -0.0003577 
## F-statistic: 0.4943 on 63 and 89037 DF,  p-value: 0.9997

#plot

library(ggplot2)
# Load packages
require(MASS) # to access Animals data sets
## Loading required package: MASS
require(scales) # to access break formatting functions
## Loading required package: scales
## 
## Attaching package: 'scales'
## The following object is masked from 'package:readr':
## 
##     col_factor
p2 <- ggplot(data, aes(x=YearsCodePro, y=CompTotal, color=edlevel)) + geom_point() +
     scale_y_log10(breaks = trans_breaks("log10", function(x) 10^x),
              labels = trans_format("log10", math_format(10^.x))) +
     theme_bw()
p2
## Warning: Transformation introduced infinite values in continuous y-axis
## Warning: Removed 83 rows containing missing values (`geom_point()`).

See given the results of the graph, comparing the compensation to the years of coding experience. There is an outlier around 8 years of coding experience, where the salary level is higher than that of the other individuals around it. This is to signify that with more years of experience, the level of salary will increase and they will be able to provide more to the organization.