This is a cheatsheet on using R to do data analysis. The main focus is on Neural Network.
#stargazer(traindt, type = "text", title="Descriptive statistics", digits=1, out="table1.txt")
#write(summary(traindt), file="bnp-data-summary.txt")
sink(file="bnp-summary-stats.txt")
print(str(bnpnet))
print(summary(bnpnet))
print(str(bnpnet))
print(summary(traindt))
print(str(testdt))
print(summary(testdt))
sink()
#simp1
#nnet
# bnpnet #bnpnet #bnpred #traindt #testdt #source('/Users/jarina/Downloads/bnp-sim/write-summary-stats.R')
bnpred <- predict(bnpnet, testdt[,c(-1,-23,-52)])
bnpnet <- nnet(traindt$target ~ ., data=traindt[,c(-1,-2,-24,-58)], size=3, MaxNWts=10000000)
testdt <- read.csv('/Users/shirish/Downloads/bnp-sim/train.csv', header = TRUE, sep = ',', fill = FALSE, colClasses = rep(’character’,135))
#removing v22, v56 and v71
References
- http://tutorials.iq.harvard.edu/R/Rgraphics/Rgraphics.html
- https://www.datacamp.com/community/tutorials/15-easy-solutions-data-frame-problems-r
R programming example
- http://heather.cs.ucdavis.edu/~matloff/R/RProg.pdf
- http://www.clemson.edu/economics/faculty/wilson/R-tutorial/graphics.html
- http://www.stat.berkeley.edu/~s133/saving.html
- http://www.stat.auckland.ac.nz/~paul/RGraphics/rgraphics.html
- http://addictedtor.free.fr/graphiques/ http://addictedtor.free.fr/graphiques/thumbs.php?sort=votes
- http://www.statmethods.net/advgraphs/layout.html
- http://lattice.r-forge.r-project.org/Vignettes/src/lattice-intro/lattice-intro.pdf
- http://www.cookbook-r.com/Graphs/Histogram_and_density_plot/
- http://www.cookbook-r.com
Missing data
- https://www3.nd.edu/~rwilliam/stats2/l12.pdf
- http://www.ats.ucla.edu/stat/sas/library/multipleimputation.pdf
- https://cran.r-project.org/web/packages/mi/mi.pdf
- https://cran.r-project.org/web/packages/Amelia/vignettes/amelia.pdf
- http://www.ats.ucla.edu/stat/sas/library/multipleimputation.pdf
- http://www.stats.ox.ac.uk/~matechou/Principles/MissingData.pdfhttp://www.princeton.edu/~otorres/sessions/s2r.pdf (very good summary slides on r)
Data stuff
- http://www.gettinggeneticsdone.com/2011/02/split-data-frame-into-testing-and.html
- http://www.cookbook-r.com/Manipulating_data/Adding_and_removing_columns_from_a_data_frame/
- http://www.statmethods.net/management/subset.html
- https://statnet.org/trac/raw-attachment/wiki/Resources/introToSNAinR_sunbelt_2012_tutorial.pdf
Network Analysis
- http://sna.stanford.edu/rlabs.php
- http://www.insna.org
- https://statnet.org/trac/raw-attachment/wiki/Resources/introToSNAinR_sunbelt_2012_tutorial.pdf
- https://www.calvin.edu/~scofield/courses/m143/materials/RcmdsFromClass.pdf
- http://statweb.stanford.edu/~susan/courses/s141/RNotes.pdf
- http://www.inside-r.org/packages/cran/igraph/docs
- http://igraph.org/r/doc/plot.common.html
- http://horicky.blogspot.com/2012/04/basic-graph-analytics-using-igraph.html (this is a good one on network analysis)
- https://cran.r-project.org/web/packages/NeuralNetTools/NeuralNetTools.pdf
- https://journal.r-project.org/archive/2010-1/RJournal_2010-1_Guenther+Fritsch.pdf
- http://www.analyticsvidhya.com/blog/2016/01/xgboost-algorithm-easy-steps/
R and NNET Reference:
- https://github.com/krishna7189/Rcodeeasy/blob/master/NEURAL%20NETWORKS-%20Detailed%20solved%20Classification%20example%20-%20Packages%20using%20%22NNET%22%20and%20%22NEURALNET%22%20in%20R
- https://beckmw.wordpress.com/tag/nnet/ (loos good)
- http://www.di.fc.ul.pt/~jpn/r/neuralnets/neuralnets.html (good compare with nnet, nueralnet, and NN with caret)
- http://gekkoquant.com/2012/05/26/neural-networks-with-r-simple-example/
- http://horicky.blogspot.com/2012/06/predictive-analytics-neuralnet-bayesian.html
xgboot libraries
R Libraries:
- library(xgboost)
- library(readr)
- library(stringr)
- library(caret)
- library(car)
- library(nnet)
- library(stats4)