SlideShare a Scribd company logo
Introduction to R for Data Science
Lecturers
dipl. ing Branko Kovač
Data Analyst at CUBE/Data Science Mentor
at Springboard
Data Science zajednica Srbije
branko.kovac@gmail.com
dr Goran S. Milovanović
Data Scientist at DiploFoundation
Data Science zajednica Srbije
goran.s.milovanovic@gmail.com
goranm@diplomacy.edu
Linear Regression in R
• Exploratory Data Analysis
• Assumptions of the Linear Model
• Correlation
• Normality Tests
• Linear Regression
• Prediction, Confidence
Intervals, Residuals
• Influential Cases and
the Influence Plot
Intro to R for Data Science
Session 6: Linear Regression in R
# Introduction to R for Data Science
# SESSION 6 :: 02 June, 2016
# clear
rm(list=ls())
#### read data
library(datasets)
data(iris)
### iris data set description:
# https://stat.ethz.ch/R-manual/R-devel/library/iriss/html/iris.html
### ExploratoryData Analysis (EDA)
str(iris)
summary(iris)
Linear Regression in R
• Before modeling: Assumptions and Exploratory Data Analysis (EDA)
Intro to R for Data Science
Session 6: Linear Regression in R
# Introduction to R for Data Science
# SESSION 6 :: 02 June, 2016
### EDA plots
# plot layout:2 x 2
par(mfcol = c(2,2))
# boxplotiris$Sepal.Length
boxplot(iris$Sepal.Length,
horizontal = TRUE,
xlab="Sepal Length")
# histogram:iris$Sepal.Length
hist(iris$Sepal.Length,
main="",
xlab="Sepal.Length",
prob=T)
# overlay iris$Sepal.Length density functionoverthe empiricaldistribution
lines(density(iris$Sepal.Length),
lty="dashed",
lwd=2.5,
col="red")
EDA
Intro to R for Data Science
Session 6: Linear Regression in R
Linear Regression in R
• EDA
Intro to R for Data Science
Session 6: Linear Regression in R
Intro to R for Data Science
Session 6: Linear Regression in R
# Introduction to R for Data Science
# SESSION 6 :: 02 June, 2016
## Pearsoncorrelationin R {base}
cor1 <- cor(iris$Sepal.Length, iris$Petal.Length,
method="pearson")
cor1
par(mfcol = c(1,1))
plot(iris$Sepal.Length, iris$Petal.Length,
main = "Sepal Length vs Petal Length",
xlab = "Sepal Length", ylab = "Petal Length")
## Correlation matrix and treatmentof missing data
dSet <- iris
# Remove one discretevariable
dSet$Species <- NULL
# introduce NA in dSet$Sepal.Length[5]
dSet$Sepal.Length[5] <- NA
# Pairwise and Listwise Deletion:
cor1a <- cor(dSet,use="complete.obs") # listwise deletion
cor1a <- cor(dSet,use="pairwise.complete.obs") # pairwise deletion
cor1a <- cor(dSet,use="all.obs") # all observations -error
Correlation
Intro to R for Data Science
Session 6: Linear Regression in R
# Introduction to R for Data Science
# SESSION 6 :: 02 June, 2016
library(Hmisc)
cor2 <- rcorr(iris$Sepal.Length,
iris$Petal.Length,
type="pearson")
cor2$r # correlations
cor2$r[1,2] # that's whatyou need,right
cor2$P # significantat
cor2$n # num.observations
# NOTE: rcorr uses Pairwise deletion!
# Correlation matrix
cor2a <- rcorr(as.matrix(dSet),
type="pearson") # NOTE:as.matrix
# select significant at alpha == .05
w <- which(!(cor2a$P<.05),arr.ind = T)
cor2a$r[w] <- NA
cor2a$P # comparew.
cor2a$r
Correlation {Hmisc}
Intro to R for Data Science
Session 6: Linear Regression in R
# Introduction to R for Data Science
# SESSION 6 :: 02 June, 2016
# LinearRegression:lm()
# Predicting:PetalLength from SepalLength
reg <- lm(Petal.Length ~ Sepal.Length, data=iris)
class(reg)
summary(reg)
coefsReg <- coefficients(reg)
coefsReg
slopeReg <- coefsReg[2]
interceptReg <- coefsReg[1]
# Prediction from this model
newSLength <- data.frame(Sepal.Length = runif(100,
min(iris$Sepal.Length),
max(iris$Sepal.Length))
) # watch the variable namesin the new data.frame!
predictPLength <- predict(reg, newSLength)
predictPLength
Linear Regression with lm()
Intro to R for Data Science
Session 6: Linear Regression in R
# Introduction to R for Data Science
# SESSION 6 :: 02 June, 2016
# Standardizedregressioncoefficients {QuantPsych}
library(QuantPsyc)
lm.beta(reg)
# Reminder:standardizedregressioncoefficientsare...
# What you would obtain upon performinglinearregressionoverstandardizedvariables
# z-score in R
zSLength <- scale(iris$Sepal.Length, center = T, scale = T) # computes z-score
zPLength <- scale(iris$Petal.Length, center = T, scale = T) # again;?scale
# new dSetw. standardized variables
dSet <- data.frame(Sepal.Length <- zSLength,
Petal.Length <- zPLength)
# LinearRegression w.lm() overstandardized variables
reg1 <- lm(Petal.Length ~ Sepal.Length, data=dSet)
summary(reg1)
# compare
coefficients(reg1)[2] # beta from reg1
lm.beta(reg) # standardizedbeta w. QuantPscy lm.beta from reg
Standardized Regression Coefficients
Intro to R for Data Science
Session 6: Linear Regression in R
# Introduction to R for Data Science
# SESSION 6 :: 02 June, 2016
# plots w. {base}and {ggplot2}
library(ggplot2)
# Predictorvs Criterion {base}
plot(iris$Sepal.Length, iris$Petal.Length,
main = "Petal Length vs Sepal Length",
xlab = "Sepal Length",
ylab = "Petal Length"
)
abline(reg,col="red")
# Predictorvs Criterion {ggplot2}
ggplot(data = iris,
aes(x = Sepal.Length, y = Petal.Length)) +
geom_point(size = 2, colour = "black") +
geom_point(size = 1, colour = "white") +
geom_smooth(aes(colour = "red"),
method='lm') +
ggtitle("Sepal Length vs Petal Length") +
xlab("Sepal Length") + ylab("Petal Length") +
theme(legend.position = "none")
Plots {base} vs {ggplot2}
Intro to R for Data Science
Session 6: Linear Regression in R
Plots {base} vs {ggplot2}
Intro to R for Data Science
Session 6: Linear Regression in R
# Introduction to R for Data Science
# SESSION 6 :: 02 June, 2016
# Predicted vs.residuals {ggplot2}
predReg <- predict(reg) # get predictions from reg
resReg <- residuals(reg) # get residuals from reg
# resStReg <- rstandard(reg)# get residualsfrom reg
plotFrame <- data.frame(predicted = predReg,
residual = resReg);
ggplot(data = plotFrame,
aes(x = predicted, y = residual)) +
geom_point(size = 2, colour = "black") +
geom_point(size = 1, colour = "white") +
geom_smooth(aes(colour = "blue"),
method='lm',
se=F) +
ggtitle("Predicted vs Residual Lengths") +
xlab("Predicted Lengths") + ylab("Residual") +
theme(legend.position = "none")
Predicted vs Residuals
Intro to R for Data Science
Session 6: Linear Regression in R
Predicted vs Residuals
Intro to R for Data Science
Session 6: Linear Regression in R
# Introduction to R for Data Science
# SESSION 6 :: 02 June, 2016
## Detectinfluentialcases
infReg <- as.data.frame(influence.measures(reg)$infmat)
# Cook's Distance:Cook and Weisberg(1982):
# values greaterthan 1 are troublesome
wCook <- which(infReg$cook.d>1) # we're fine here
# Average Leverage = (k+1)/n,k - num. of predictors,n - num. observations
# Also termed:hat values,range:0 - 1
# see: https://en.wikipedia.org/wiki/Leverage_%28statistics%29
# Various criteria (twice the leverage,three times the average...)
wLev <- which(infReg$hat>2*(2/length(iris$price))) # we seem to be fine here too...
## Influenceplot
infReg <- as.data.frame(influence.measures(reg)$infmat)
plotFrame <- data.frame(residual = resStReg,
leverage = infReg$hat,
cookD = infReg$cook.d)
Infulential Cases + Infulence Plot
Intro to R for Data Science
Session 6: Linear Regression in R
# Introduction to R for Data Science
# SESSION 6 :: 02 June, 2016
ggplot(plotFrame,
aes(y = residual,
x = leverage)) +
geom_point(size = plotFrame$cookD*100, shape = 1) +
ggtitle("Influence PlotnSize of the circle corresponds to Cook's distance") +
theme(plot.title = element_text(size=8, face="bold")) +
ylab("Standardized Residual") + xlab("Leverage")
Infulence Plot
Intro to R for Data Science
Session 6: Linear Regression in R
Infulence Plot
Intro to R for Data Science
Session 6: Linear Regression in R
Introduction to R for Data Science :: Session 6 [Linear Regression in R]
Ad

More Related Content

What's hot (20)

Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)
Guy Lebanon
 
RDataMining slides-text-mining-with-r
RDataMining slides-text-mining-with-rRDataMining slides-text-mining-with-r
RDataMining slides-text-mining-with-r
Yanchang Zhao
 
R language
R languageR language
R language
LearningTech
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout
source{d}
 
Text mining and social network analysis of twitter data part 1
Text mining and social network analysis of twitter data part 1Text mining and social network analysis of twitter data part 1
Text mining and social network analysis of twitter data part 1
Johan Blomme
 
Training in Analytics, R and Social Media Analytics
Training in Analytics, R and Social Media AnalyticsTraining in Analytics, R and Social Media Analytics
Training in Analytics, R and Social Media Analytics
Ajay Ohri
 
Machine Learning in R
Machine Learning in RMachine Learning in R
Machine Learning in R
Alexandros Karatzoglou
 
Hybrid acquisition of temporal scopes for rdf data
Hybrid acquisition of temporal scopes for rdf dataHybrid acquisition of temporal scopes for rdf data
Hybrid acquisition of temporal scopes for rdf data
Anisa Rula
 
C programming
C programmingC programming
C programming
Karthikeyan A K
 
Text analytics in Python and R with examples from Tobacco Control
Text analytics in Python and R with examples from Tobacco ControlText analytics in Python and R with examples from Tobacco Control
Text analytics in Python and R with examples from Tobacco Control
Ben Healey
 
Detecting paraphrases using recursive autoencoders
Detecting paraphrases using recursive autoencodersDetecting paraphrases using recursive autoencoders
Detecting paraphrases using recursive autoencoders
Feynman Liang
 
Recursive Autoencoders for Paraphrase Detection (Socher et al)
Recursive Autoencoders for Paraphrase Detection (Socher et al)Recursive Autoencoders for Paraphrase Detection (Socher et al)
Recursive Autoencoders for Paraphrase Detection (Socher et al)
Feynman Liang
 
Stack Algorithm
Stack AlgorithmStack Algorithm
Stack Algorithm
Kamal Singh Lodhi
 
SPARQL in a nutshell
SPARQL in a nutshellSPARQL in a nutshell
SPARQL in a nutshell
Fabien Gandon
 
A brief introduction to lisp language
A brief introduction to lisp languageA brief introduction to lisp language
A brief introduction to lisp language
David Gu
 
Rbootcamp Day 1
Rbootcamp Day 1Rbootcamp Day 1
Rbootcamp Day 1
Olga Scrivner
 
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
dankogai
 
Natural Language Processing in R (rNLP)
Natural Language Processing in R (rNLP)Natural Language Processing in R (rNLP)
Natural Language Processing in R (rNLP)
fridolin.wild
 
Federation and Navigation in SPARQL 1.1
Federation and Navigation in SPARQL 1.1Federation and Navigation in SPARQL 1.1
Federation and Navigation in SPARQL 1.1
net2-project
 
Reproducible Computational Research in R
Reproducible Computational Research in RReproducible Computational Research in R
Reproducible Computational Research in R
Samuel Bosch
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)
Guy Lebanon
 
RDataMining slides-text-mining-with-r
RDataMining slides-text-mining-with-rRDataMining slides-text-mining-with-r
RDataMining slides-text-mining-with-r
Yanchang Zhao
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout
source{d}
 
Text mining and social network analysis of twitter data part 1
Text mining and social network analysis of twitter data part 1Text mining and social network analysis of twitter data part 1
Text mining and social network analysis of twitter data part 1
Johan Blomme
 
Training in Analytics, R and Social Media Analytics
Training in Analytics, R and Social Media AnalyticsTraining in Analytics, R and Social Media Analytics
Training in Analytics, R and Social Media Analytics
Ajay Ohri
 
Hybrid acquisition of temporal scopes for rdf data
Hybrid acquisition of temporal scopes for rdf dataHybrid acquisition of temporal scopes for rdf data
Hybrid acquisition of temporal scopes for rdf data
Anisa Rula
 
Text analytics in Python and R with examples from Tobacco Control
Text analytics in Python and R with examples from Tobacco ControlText analytics in Python and R with examples from Tobacco Control
Text analytics in Python and R with examples from Tobacco Control
Ben Healey
 
Detecting paraphrases using recursive autoencoders
Detecting paraphrases using recursive autoencodersDetecting paraphrases using recursive autoencoders
Detecting paraphrases using recursive autoencoders
Feynman Liang
 
Recursive Autoencoders for Paraphrase Detection (Socher et al)
Recursive Autoencoders for Paraphrase Detection (Socher et al)Recursive Autoencoders for Paraphrase Detection (Socher et al)
Recursive Autoencoders for Paraphrase Detection (Socher et al)
Feynman Liang
 
SPARQL in a nutshell
SPARQL in a nutshellSPARQL in a nutshell
SPARQL in a nutshell
Fabien Gandon
 
A brief introduction to lisp language
A brief introduction to lisp languageA brief introduction to lisp language
A brief introduction to lisp language
David Gu
 
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
dankogai
 
Natural Language Processing in R (rNLP)
Natural Language Processing in R (rNLP)Natural Language Processing in R (rNLP)
Natural Language Processing in R (rNLP)
fridolin.wild
 
Federation and Navigation in SPARQL 1.1
Federation and Navigation in SPARQL 1.1Federation and Navigation in SPARQL 1.1
Federation and Navigation in SPARQL 1.1
net2-project
 
Reproducible Computational Research in R
Reproducible Computational Research in RReproducible Computational Research in R
Reproducible Computational Research in R
Samuel Bosch
 

Viewers also liked (18)

Latest seo news, tips and tricks website lists
Latest seo news, tips and tricks website listsLatest seo news, tips and tricks website lists
Latest seo news, tips and tricks website lists
Manickam Srinivasan
 
Electron Configuration
Electron ConfigurationElectron Configuration
Electron Configuration
crumpjason
 
Uvod u R za Data Science :: Sesija 1 [Intro to R for Data Science :: Session 1]
Uvod u R za Data Science :: Sesija 1 [Intro to R for Data Science :: Session 1]Uvod u R za Data Science :: Sesija 1 [Intro to R for Data Science :: Session 1]
Uvod u R za Data Science :: Sesija 1 [Intro to R for Data Science :: Session 1]
Goran S. Milovanovic
 
Benefits of Short Term Contract Hire
Benefits of Short Term Contract HireBenefits of Short Term Contract Hire
Benefits of Short Term Contract Hire
Rhys Adams
 
Building a Scalable Data Science Platform with R
Building a Scalable Data Science Platform with RBuilding a Scalable Data Science Platform with R
Building a Scalable Data Science Platform with R
DataWorks Summit/Hadoop Summit
 
Slides erm-cea-ia
Slides erm-cea-iaSlides erm-cea-ia
Slides erm-cea-ia
Arthur Charpentier
 
IA-advanced-R
IA-advanced-RIA-advanced-R
IA-advanced-R
Arthur Charpentier
 
Slides ads ia
Slides ads iaSlides ads ia
Slides ads ia
Arthur Charpentier
 
Classification
ClassificationClassification
Classification
Arthur Charpentier
 
Slides lln-risques
Slides lln-risquesSlides lln-risques
Slides lln-risques
Arthur Charpentier
 
15 03 16_data sciences pour l'actuariat_f. soulie fogelman
15 03 16_data sciences pour l'actuariat_f. soulie fogelman15 03 16_data sciences pour l'actuariat_f. soulie fogelman
15 03 16_data sciences pour l'actuariat_f. soulie fogelman
Arthur Charpentier
 
Building a Graph Database in Neo4j with Spark & Spark SQL to gain new insight...
Building a Graph Database in Neo4j with Spark & Spark SQL to gain new insight...Building a Graph Database in Neo4j with Spark & Spark SQL to gain new insight...
Building a Graph Database in Neo4j with Spark & Spark SQL to gain new insight...
DataWorks Summit/Hadoop Summit
 
Slides barcelona Machine Learning
Slides barcelona Machine LearningSlides barcelona Machine Learning
Slides barcelona Machine Learning
Arthur Charpentier
 
12 Hidden Tips of Popular Remote Work Tools
12 Hidden Tips of Popular Remote Work Tools12 Hidden Tips of Popular Remote Work Tools
12 Hidden Tips of Popular Remote Work Tools
RealtimeBoard
 
Freelance@toptal
Freelance@toptalFreelance@toptal
Freelance@toptal
Ivo Gregurec
 
Spatial Data Science with R
Spatial Data Science with RSpatial Data Science with R
Spatial Data Science with R
amsantac
 
Actuarial Analytics in R
Actuarial Analytics in RActuarial Analytics in R
Actuarial Analytics in R
Revolution Analytics
 
TextMining with R
TextMining with RTextMining with R
TextMining with R
Aleksei Beloshytski
 
Latest seo news, tips and tricks website lists
Latest seo news, tips and tricks website listsLatest seo news, tips and tricks website lists
Latest seo news, tips and tricks website lists
Manickam Srinivasan
 
Electron Configuration
Electron ConfigurationElectron Configuration
Electron Configuration
crumpjason
 
Uvod u R za Data Science :: Sesija 1 [Intro to R for Data Science :: Session 1]
Uvod u R za Data Science :: Sesija 1 [Intro to R for Data Science :: Session 1]Uvod u R za Data Science :: Sesija 1 [Intro to R for Data Science :: Session 1]
Uvod u R za Data Science :: Sesija 1 [Intro to R for Data Science :: Session 1]
Goran S. Milovanovic
 
Benefits of Short Term Contract Hire
Benefits of Short Term Contract HireBenefits of Short Term Contract Hire
Benefits of Short Term Contract Hire
Rhys Adams
 
15 03 16_data sciences pour l'actuariat_f. soulie fogelman
15 03 16_data sciences pour l'actuariat_f. soulie fogelman15 03 16_data sciences pour l'actuariat_f. soulie fogelman
15 03 16_data sciences pour l'actuariat_f. soulie fogelman
Arthur Charpentier
 
Building a Graph Database in Neo4j with Spark & Spark SQL to gain new insight...
Building a Graph Database in Neo4j with Spark & Spark SQL to gain new insight...Building a Graph Database in Neo4j with Spark & Spark SQL to gain new insight...
Building a Graph Database in Neo4j with Spark & Spark SQL to gain new insight...
DataWorks Summit/Hadoop Summit
 
Slides barcelona Machine Learning
Slides barcelona Machine LearningSlides barcelona Machine Learning
Slides barcelona Machine Learning
Arthur Charpentier
 
12 Hidden Tips of Popular Remote Work Tools
12 Hidden Tips of Popular Remote Work Tools12 Hidden Tips of Popular Remote Work Tools
12 Hidden Tips of Popular Remote Work Tools
RealtimeBoard
 
Spatial Data Science with R
Spatial Data Science with RSpatial Data Science with R
Spatial Data Science with R
amsantac
 
Ad

Similar to Introduction to R for Data Science :: Session 6 [Linear Regression in R] (20)

Rattle Graphical Interface for R Language
Rattle Graphical Interface for R LanguageRattle Graphical Interface for R Language
Rattle Graphical Interface for R Language
Majid Abdollahi
 
Introduction to R for data science
Introduction to R for data scienceIntroduction to R for data science
Introduction to R for data science
Long Nguyen
 
Extending lifespan with Hadoop and R
Extending lifespan with Hadoop and RExtending lifespan with Hadoop and R
Extending lifespan with Hadoop and R
Radek Maciaszek
 
Rtutorial
RtutorialRtutorial
Rtutorial
Dheeraj Dwivedi
 
R seminar dplyr package
R seminar dplyr packageR seminar dplyr package
R seminar dplyr package
Muhammad Nabi Ahmad
 
Gsas intro rvd (1)
Gsas intro rvd (1)Gsas intro rvd (1)
Gsas intro rvd (1)
José da Silva Rabelo Neto
 
lecture-Basic-programing-R-1-basic-eng.pptx
lecture-Basic-programing-R-1-basic-eng.pptxlecture-Basic-programing-R-1-basic-eng.pptx
lecture-Basic-programing-R-1-basic-eng.pptx
ThoVyNguynVng
 
DATA MINING USING R (1).pptx
DATA MINING USING R (1).pptxDATA MINING USING R (1).pptx
DATA MINING USING R (1).pptx
myworld93
 
Language Technology Enhanced Learning
Language Technology Enhanced LearningLanguage Technology Enhanced Learning
Language Technology Enhanced Learning
telss09
 
3rd Athens Big Data Meetup - 2nd Talk - Neo4j: The World's Leading Graph DB
3rd Athens Big Data Meetup - 2nd Talk - Neo4j: The World's Leading Graph DB3rd Athens Big Data Meetup - 2nd Talk - Neo4j: The World's Leading Graph DB
3rd Athens Big Data Meetup - 2nd Talk - Neo4j: The World's Leading Graph DB
Athens Big Data
 
User biglm
User biglmUser biglm
User biglm
johnatan pladott
 
Compiling openCypher graph queries with Spark Catalyst
Compiling openCypher graph queries with Spark CatalystCompiling openCypher graph queries with Spark Catalyst
Compiling openCypher graph queries with Spark Catalyst
Gábor Szárnyas
 
R Language Introduction
R Language IntroductionR Language Introduction
R Language Introduction
Khaled Al-Shamaa
 
An Introduction to Data Mining with R
An Introduction to Data Mining with RAn Introduction to Data Mining with R
An Introduction to Data Mining with R
Yanchang Zhao
 
R programming & Machine Learning
R programming & Machine LearningR programming & Machine Learning
R programming & Machine Learning
AmanBhalla14
 
Data analysis with R
Data analysis with RData analysis with R
Data analysis with R
ShareThis
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
agnonchik
 
introtorandrstudio.ppt
introtorandrstudio.pptintrotorandrstudio.ppt
introtorandrstudio.ppt
MalkaParveen3
 
Hands on data science with r.pptx
Hands  on data science with r.pptxHands  on data science with r.pptx
Hands on data science with r.pptx
Nimrita Koul
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdf
RohanBorgalli
 
Rattle Graphical Interface for R Language
Rattle Graphical Interface for R LanguageRattle Graphical Interface for R Language
Rattle Graphical Interface for R Language
Majid Abdollahi
 
Introduction to R for data science
Introduction to R for data scienceIntroduction to R for data science
Introduction to R for data science
Long Nguyen
 
Extending lifespan with Hadoop and R
Extending lifespan with Hadoop and RExtending lifespan with Hadoop and R
Extending lifespan with Hadoop and R
Radek Maciaszek
 
lecture-Basic-programing-R-1-basic-eng.pptx
lecture-Basic-programing-R-1-basic-eng.pptxlecture-Basic-programing-R-1-basic-eng.pptx
lecture-Basic-programing-R-1-basic-eng.pptx
ThoVyNguynVng
 
DATA MINING USING R (1).pptx
DATA MINING USING R (1).pptxDATA MINING USING R (1).pptx
DATA MINING USING R (1).pptx
myworld93
 
Language Technology Enhanced Learning
Language Technology Enhanced LearningLanguage Technology Enhanced Learning
Language Technology Enhanced Learning
telss09
 
3rd Athens Big Data Meetup - 2nd Talk - Neo4j: The World's Leading Graph DB
3rd Athens Big Data Meetup - 2nd Talk - Neo4j: The World's Leading Graph DB3rd Athens Big Data Meetup - 2nd Talk - Neo4j: The World's Leading Graph DB
3rd Athens Big Data Meetup - 2nd Talk - Neo4j: The World's Leading Graph DB
Athens Big Data
 
Compiling openCypher graph queries with Spark Catalyst
Compiling openCypher graph queries with Spark CatalystCompiling openCypher graph queries with Spark Catalyst
Compiling openCypher graph queries with Spark Catalyst
Gábor Szárnyas
 
An Introduction to Data Mining with R
An Introduction to Data Mining with RAn Introduction to Data Mining with R
An Introduction to Data Mining with R
Yanchang Zhao
 
R programming & Machine Learning
R programming & Machine LearningR programming & Machine Learning
R programming & Machine Learning
AmanBhalla14
 
Data analysis with R
Data analysis with RData analysis with R
Data analysis with R
ShareThis
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
agnonchik
 
introtorandrstudio.ppt
introtorandrstudio.pptintrotorandrstudio.ppt
introtorandrstudio.ppt
MalkaParveen3
 
Hands on data science with r.pptx
Hands  on data science with r.pptxHands  on data science with r.pptx
Hands on data science with r.pptx
Nimrita Koul
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdf
RohanBorgalli
 
Ad

More from Goran S. Milovanovic (20)

Geneva Social Media Index - Report 2015 full report
Geneva Social Media Index - Report 2015 full reportGeneva Social Media Index - Report 2015 full report
Geneva Social Media Index - Report 2015 full report
Goran S. Milovanovic
 
Milovanović, G.S., Krstić, M. & Filipović, O. (2015). Kršenje homogenosti pre...
Milovanović, G.S., Krstić, M. & Filipović, O. (2015). Kršenje homogenosti pre...Milovanović, G.S., Krstić, M. & Filipović, O. (2015). Kršenje homogenosti pre...
Milovanović, G.S., Krstić, M. & Filipović, O. (2015). Kršenje homogenosti pre...
Goran S. Milovanovic
 
247113920-Cognitive-technologies-mapping-the-Internet-governance-debate
247113920-Cognitive-technologies-mapping-the-Internet-governance-debate247113920-Cognitive-technologies-mapping-the-Internet-governance-debate
247113920-Cognitive-technologies-mapping-the-Internet-governance-debate
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 10. Simboličke funkcije, VI Deo: Rešavanje p...
Učenje i viši kognitivni procesi 10. Simboličke funkcije, VI Deo: Rešavanje p...Učenje i viši kognitivni procesi 10. Simboličke funkcije, VI Deo: Rešavanje p...
Učenje i viši kognitivni procesi 10. Simboličke funkcije, VI Deo: Rešavanje p...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Rezonovanje u...
Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Rezonovanje u...Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Rezonovanje u...
Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Rezonovanje u...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Suđenje, heur...
Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Suđenje, heur...Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Suđenje, heur...
Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Suđenje, heur...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 8. Simboličke funkcije, IV Deo: Analogija i ...
Učenje i viši kognitivni procesi 8. Simboličke funkcije, IV Deo: Analogija i ...Učenje i viši kognitivni procesi 8. Simboličke funkcije, IV Deo: Analogija i ...
Učenje i viši kognitivni procesi 8. Simboličke funkcije, IV Deo: Analogija i ...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 9. Simboličke funkcije, III Deo: Kauzalnost,...
Učenje i viši kognitivni procesi 9. Simboličke funkcije, III Deo: Kauzalnost,...Učenje i viši kognitivni procesi 9. Simboličke funkcije, III Deo: Kauzalnost,...
Učenje i viši kognitivni procesi 9. Simboličke funkcije, III Deo: Kauzalnost,...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Distribuiran...
Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Distribuiran...Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Distribuiran...
Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Distribuiran...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Konekcioniza...
Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Konekcioniza...Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Konekcioniza...
Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Konekcioniza...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 7a. Simboličke funkcije, I Deo: Učenje kateg...
Učenje i viši kognitivni procesi 7a. Simboličke funkcije, I Deo: Učenje kateg...Učenje i viši kognitivni procesi 7a. Simboličke funkcije, I Deo: Učenje kateg...
Učenje i viši kognitivni procesi 7a. Simboličke funkcije, I Deo: Učenje kateg...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 7. Simboličke funkcije, I Deo: Koncepti, kat...
Učenje i viši kognitivni procesi 7. Simboličke funkcije, I Deo: Koncepti, kat...Učenje i viši kognitivni procesi 7. Simboličke funkcije, I Deo: Koncepti, kat...
Učenje i viši kognitivni procesi 7. Simboličke funkcije, I Deo: Koncepti, kat...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 7. Učenje, IV Deo: Neasocijativno učenje, ef...
Učenje i viši kognitivni procesi 7. Učenje, IV Deo: Neasocijativno učenje, ef...Učenje i viši kognitivni procesi 7. Učenje, IV Deo: Neasocijativno učenje, ef...
Učenje i viši kognitivni procesi 7. Učenje, IV Deo: Neasocijativno učenje, ef...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 6. Učenje, III Deo: Hernstejnov zakon slagan...
Učenje i viši kognitivni procesi 6. Učenje, III Deo: Hernstejnov zakon slagan...Učenje i viši kognitivni procesi 6. Učenje, III Deo: Hernstejnov zakon slagan...
Učenje i viši kognitivni procesi 6. Učenje, III Deo: Hernstejnov zakon slagan...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 6. Učenje, III Deo: Instrumentalno učenje
Učenje i viši kognitivni procesi 6. Učenje, III Deo: Instrumentalno učenjeUčenje i viši kognitivni procesi 6. Učenje, III Deo: Instrumentalno učenje
Učenje i viši kognitivni procesi 6. Učenje, III Deo: Instrumentalno učenje
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 5. Učenje, II Deo: Blokiranje, osenčavanje, ...
Učenje i viši kognitivni procesi 5. Učenje, II Deo: Blokiranje, osenčavanje, ...Učenje i viši kognitivni procesi 5. Učenje, II Deo: Blokiranje, osenčavanje, ...
Učenje i viši kognitivni procesi 5. Učenje, II Deo: Blokiranje, osenčavanje, ...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 5. Učenje, II Deo: klasično uslovljavanje i ...
Učenje i viši kognitivni procesi 5. Učenje, II Deo: klasično uslovljavanje i ...Učenje i viši kognitivni procesi 5. Učenje, II Deo: klasično uslovljavanje i ...
Učenje i viši kognitivni procesi 5. Učenje, II Deo: klasično uslovljavanje i ...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 5. Učenje, I Deo
Učenje i viši kognitivni procesi 5. Učenje, I DeoUčenje i viši kognitivni procesi 5. Učenje, I Deo
Učenje i viši kognitivni procesi 5. Učenje, I Deo
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 4a. Debata o racionalnosti, nastavak
Učenje i viši kognitivni procesi 4a. Debata o racionalnosti, nastavakUčenje i viši kognitivni procesi 4a. Debata o racionalnosti, nastavak
Učenje i viši kognitivni procesi 4a. Debata o racionalnosti, nastavak
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 4. Debata o racionalnosti
Učenje i viši kognitivni procesi 4. Debata o racionalnostiUčenje i viši kognitivni procesi 4. Debata o racionalnosti
Učenje i viši kognitivni procesi 4. Debata o racionalnosti
Goran S. Milovanovic
 
Geneva Social Media Index - Report 2015 full report
Geneva Social Media Index - Report 2015 full reportGeneva Social Media Index - Report 2015 full report
Geneva Social Media Index - Report 2015 full report
Goran S. Milovanovic
 
Milovanović, G.S., Krstić, M. & Filipović, O. (2015). Kršenje homogenosti pre...
Milovanović, G.S., Krstić, M. & Filipović, O. (2015). Kršenje homogenosti pre...Milovanović, G.S., Krstić, M. & Filipović, O. (2015). Kršenje homogenosti pre...
Milovanović, G.S., Krstić, M. & Filipović, O. (2015). Kršenje homogenosti pre...
Goran S. Milovanovic
 
247113920-Cognitive-technologies-mapping-the-Internet-governance-debate
247113920-Cognitive-technologies-mapping-the-Internet-governance-debate247113920-Cognitive-technologies-mapping-the-Internet-governance-debate
247113920-Cognitive-technologies-mapping-the-Internet-governance-debate
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 10. Simboličke funkcije, VI Deo: Rešavanje p...
Učenje i viši kognitivni procesi 10. Simboličke funkcije, VI Deo: Rešavanje p...Učenje i viši kognitivni procesi 10. Simboličke funkcije, VI Deo: Rešavanje p...
Učenje i viši kognitivni procesi 10. Simboličke funkcije, VI Deo: Rešavanje p...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Rezonovanje u...
Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Rezonovanje u...Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Rezonovanje u...
Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Rezonovanje u...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Suđenje, heur...
Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Suđenje, heur...Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Suđenje, heur...
Učenje i viši kognitivni procesi 9. Simboličke funkcije, V Deo: Suđenje, heur...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 8. Simboličke funkcije, IV Deo: Analogija i ...
Učenje i viši kognitivni procesi 8. Simboličke funkcije, IV Deo: Analogija i ...Učenje i viši kognitivni procesi 8. Simboličke funkcije, IV Deo: Analogija i ...
Učenje i viši kognitivni procesi 8. Simboličke funkcije, IV Deo: Analogija i ...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 9. Simboličke funkcije, III Deo: Kauzalnost,...
Učenje i viši kognitivni procesi 9. Simboličke funkcije, III Deo: Kauzalnost,...Učenje i viši kognitivni procesi 9. Simboličke funkcije, III Deo: Kauzalnost,...
Učenje i viši kognitivni procesi 9. Simboličke funkcije, III Deo: Kauzalnost,...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Distribuiran...
Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Distribuiran...Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Distribuiran...
Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Distribuiran...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Konekcioniza...
Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Konekcioniza...Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Konekcioniza...
Učenje i viši kognitivni procesi 8. Simboličke funkcije, II Deo: Konekcioniza...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 7a. Simboličke funkcije, I Deo: Učenje kateg...
Učenje i viši kognitivni procesi 7a. Simboličke funkcije, I Deo: Učenje kateg...Učenje i viši kognitivni procesi 7a. Simboličke funkcije, I Deo: Učenje kateg...
Učenje i viši kognitivni procesi 7a. Simboličke funkcije, I Deo: Učenje kateg...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 7. Simboličke funkcije, I Deo: Koncepti, kat...
Učenje i viši kognitivni procesi 7. Simboličke funkcije, I Deo: Koncepti, kat...Učenje i viši kognitivni procesi 7. Simboličke funkcije, I Deo: Koncepti, kat...
Učenje i viši kognitivni procesi 7. Simboličke funkcije, I Deo: Koncepti, kat...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 7. Učenje, IV Deo: Neasocijativno učenje, ef...
Učenje i viši kognitivni procesi 7. Učenje, IV Deo: Neasocijativno učenje, ef...Učenje i viši kognitivni procesi 7. Učenje, IV Deo: Neasocijativno učenje, ef...
Učenje i viši kognitivni procesi 7. Učenje, IV Deo: Neasocijativno učenje, ef...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 6. Učenje, III Deo: Hernstejnov zakon slagan...
Učenje i viši kognitivni procesi 6. Učenje, III Deo: Hernstejnov zakon slagan...Učenje i viši kognitivni procesi 6. Učenje, III Deo: Hernstejnov zakon slagan...
Učenje i viši kognitivni procesi 6. Učenje, III Deo: Hernstejnov zakon slagan...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 6. Učenje, III Deo: Instrumentalno učenje
Učenje i viši kognitivni procesi 6. Učenje, III Deo: Instrumentalno učenjeUčenje i viši kognitivni procesi 6. Učenje, III Deo: Instrumentalno učenje
Učenje i viši kognitivni procesi 6. Učenje, III Deo: Instrumentalno učenje
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 5. Učenje, II Deo: Blokiranje, osenčavanje, ...
Učenje i viši kognitivni procesi 5. Učenje, II Deo: Blokiranje, osenčavanje, ...Učenje i viši kognitivni procesi 5. Učenje, II Deo: Blokiranje, osenčavanje, ...
Učenje i viši kognitivni procesi 5. Učenje, II Deo: Blokiranje, osenčavanje, ...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 5. Učenje, II Deo: klasično uslovljavanje i ...
Učenje i viši kognitivni procesi 5. Učenje, II Deo: klasično uslovljavanje i ...Učenje i viši kognitivni procesi 5. Učenje, II Deo: klasično uslovljavanje i ...
Učenje i viši kognitivni procesi 5. Učenje, II Deo: klasično uslovljavanje i ...
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 5. Učenje, I Deo
Učenje i viši kognitivni procesi 5. Učenje, I DeoUčenje i viši kognitivni procesi 5. Učenje, I Deo
Učenje i viši kognitivni procesi 5. Učenje, I Deo
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 4a. Debata o racionalnosti, nastavak
Učenje i viši kognitivni procesi 4a. Debata o racionalnosti, nastavakUčenje i viši kognitivni procesi 4a. Debata o racionalnosti, nastavak
Učenje i viši kognitivni procesi 4a. Debata o racionalnosti, nastavak
Goran S. Milovanovic
 
Učenje i viši kognitivni procesi 4. Debata o racionalnosti
Učenje i viši kognitivni procesi 4. Debata o racionalnostiUčenje i viši kognitivni procesi 4. Debata o racionalnosti
Učenje i viši kognitivni procesi 4. Debata o racionalnosti
Goran S. Milovanovic
 

Recently uploaded (20)

YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Real GitHub Copilot Exam Dumps for Success
Real GitHub Copilot Exam Dumps for SuccessReal GitHub Copilot Exam Dumps for Success
Real GitHub Copilot Exam Dumps for Success
Mark Soia
 
Sugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptxSugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptx
Dr. Renu Jangid
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Contact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: OptometryContact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: Optometry
MushahidRaza8
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdfIntroduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
james5028
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Link your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRMLink your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRM
Celine George
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Real GitHub Copilot Exam Dumps for Success
Real GitHub Copilot Exam Dumps for SuccessReal GitHub Copilot Exam Dumps for Success
Real GitHub Copilot Exam Dumps for Success
Mark Soia
 
Sugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptxSugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptx
Dr. Renu Jangid
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Contact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: OptometryContact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: Optometry
MushahidRaza8
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdfIntroduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
james5028
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Link your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRMLink your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRM
Celine George
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 

Introduction to R for Data Science :: Session 6 [Linear Regression in R]

  • 1. Introduction to R for Data Science Lecturers dipl. ing Branko Kovač Data Analyst at CUBE/Data Science Mentor at Springboard Data Science zajednica Srbije [email protected] dr Goran S. Milovanović Data Scientist at DiploFoundation Data Science zajednica Srbije [email protected] [email protected]
  • 2. Linear Regression in R • Exploratory Data Analysis • Assumptions of the Linear Model • Correlation • Normality Tests • Linear Regression • Prediction, Confidence Intervals, Residuals • Influential Cases and the Influence Plot Intro to R for Data Science Session 6: Linear Regression in R
  • 3. # Introduction to R for Data Science # SESSION 6 :: 02 June, 2016 # clear rm(list=ls()) #### read data library(datasets) data(iris) ### iris data set description: # https://stat.ethz.ch/R-manual/R-devel/library/iriss/html/iris.html ### ExploratoryData Analysis (EDA) str(iris) summary(iris) Linear Regression in R • Before modeling: Assumptions and Exploratory Data Analysis (EDA) Intro to R for Data Science Session 6: Linear Regression in R
  • 4. # Introduction to R for Data Science # SESSION 6 :: 02 June, 2016 ### EDA plots # plot layout:2 x 2 par(mfcol = c(2,2)) # boxplotiris$Sepal.Length boxplot(iris$Sepal.Length, horizontal = TRUE, xlab="Sepal Length") # histogram:iris$Sepal.Length hist(iris$Sepal.Length, main="", xlab="Sepal.Length", prob=T) # overlay iris$Sepal.Length density functionoverthe empiricaldistribution lines(density(iris$Sepal.Length), lty="dashed", lwd=2.5, col="red") EDA Intro to R for Data Science Session 6: Linear Regression in R
  • 5. Linear Regression in R • EDA Intro to R for Data Science Session 6: Linear Regression in R
  • 6. Intro to R for Data Science Session 6: Linear Regression in R
  • 7. # Introduction to R for Data Science # SESSION 6 :: 02 June, 2016 ## Pearsoncorrelationin R {base} cor1 <- cor(iris$Sepal.Length, iris$Petal.Length, method="pearson") cor1 par(mfcol = c(1,1)) plot(iris$Sepal.Length, iris$Petal.Length, main = "Sepal Length vs Petal Length", xlab = "Sepal Length", ylab = "Petal Length") ## Correlation matrix and treatmentof missing data dSet <- iris # Remove one discretevariable dSet$Species <- NULL # introduce NA in dSet$Sepal.Length[5] dSet$Sepal.Length[5] <- NA # Pairwise and Listwise Deletion: cor1a <- cor(dSet,use="complete.obs") # listwise deletion cor1a <- cor(dSet,use="pairwise.complete.obs") # pairwise deletion cor1a <- cor(dSet,use="all.obs") # all observations -error Correlation Intro to R for Data Science Session 6: Linear Regression in R
  • 8. # Introduction to R for Data Science # SESSION 6 :: 02 June, 2016 library(Hmisc) cor2 <- rcorr(iris$Sepal.Length, iris$Petal.Length, type="pearson") cor2$r # correlations cor2$r[1,2] # that's whatyou need,right cor2$P # significantat cor2$n # num.observations # NOTE: rcorr uses Pairwise deletion! # Correlation matrix cor2a <- rcorr(as.matrix(dSet), type="pearson") # NOTE:as.matrix # select significant at alpha == .05 w <- which(!(cor2a$P<.05),arr.ind = T) cor2a$r[w] <- NA cor2a$P # comparew. cor2a$r Correlation {Hmisc} Intro to R for Data Science Session 6: Linear Regression in R
  • 9. # Introduction to R for Data Science # SESSION 6 :: 02 June, 2016 # LinearRegression:lm() # Predicting:PetalLength from SepalLength reg <- lm(Petal.Length ~ Sepal.Length, data=iris) class(reg) summary(reg) coefsReg <- coefficients(reg) coefsReg slopeReg <- coefsReg[2] interceptReg <- coefsReg[1] # Prediction from this model newSLength <- data.frame(Sepal.Length = runif(100, min(iris$Sepal.Length), max(iris$Sepal.Length)) ) # watch the variable namesin the new data.frame! predictPLength <- predict(reg, newSLength) predictPLength Linear Regression with lm() Intro to R for Data Science Session 6: Linear Regression in R
  • 10. # Introduction to R for Data Science # SESSION 6 :: 02 June, 2016 # Standardizedregressioncoefficients {QuantPsych} library(QuantPsyc) lm.beta(reg) # Reminder:standardizedregressioncoefficientsare... # What you would obtain upon performinglinearregressionoverstandardizedvariables # z-score in R zSLength <- scale(iris$Sepal.Length, center = T, scale = T) # computes z-score zPLength <- scale(iris$Petal.Length, center = T, scale = T) # again;?scale # new dSetw. standardized variables dSet <- data.frame(Sepal.Length <- zSLength, Petal.Length <- zPLength) # LinearRegression w.lm() overstandardized variables reg1 <- lm(Petal.Length ~ Sepal.Length, data=dSet) summary(reg1) # compare coefficients(reg1)[2] # beta from reg1 lm.beta(reg) # standardizedbeta w. QuantPscy lm.beta from reg Standardized Regression Coefficients Intro to R for Data Science Session 6: Linear Regression in R
  • 11. # Introduction to R for Data Science # SESSION 6 :: 02 June, 2016 # plots w. {base}and {ggplot2} library(ggplot2) # Predictorvs Criterion {base} plot(iris$Sepal.Length, iris$Petal.Length, main = "Petal Length vs Sepal Length", xlab = "Sepal Length", ylab = "Petal Length" ) abline(reg,col="red") # Predictorvs Criterion {ggplot2} ggplot(data = iris, aes(x = Sepal.Length, y = Petal.Length)) + geom_point(size = 2, colour = "black") + geom_point(size = 1, colour = "white") + geom_smooth(aes(colour = "red"), method='lm') + ggtitle("Sepal Length vs Petal Length") + xlab("Sepal Length") + ylab("Petal Length") + theme(legend.position = "none") Plots {base} vs {ggplot2} Intro to R for Data Science Session 6: Linear Regression in R
  • 12. Plots {base} vs {ggplot2} Intro to R for Data Science Session 6: Linear Regression in R
  • 13. # Introduction to R for Data Science # SESSION 6 :: 02 June, 2016 # Predicted vs.residuals {ggplot2} predReg <- predict(reg) # get predictions from reg resReg <- residuals(reg) # get residuals from reg # resStReg <- rstandard(reg)# get residualsfrom reg plotFrame <- data.frame(predicted = predReg, residual = resReg); ggplot(data = plotFrame, aes(x = predicted, y = residual)) + geom_point(size = 2, colour = "black") + geom_point(size = 1, colour = "white") + geom_smooth(aes(colour = "blue"), method='lm', se=F) + ggtitle("Predicted vs Residual Lengths") + xlab("Predicted Lengths") + ylab("Residual") + theme(legend.position = "none") Predicted vs Residuals Intro to R for Data Science Session 6: Linear Regression in R
  • 14. Predicted vs Residuals Intro to R for Data Science Session 6: Linear Regression in R
  • 15. # Introduction to R for Data Science # SESSION 6 :: 02 June, 2016 ## Detectinfluentialcases infReg <- as.data.frame(influence.measures(reg)$infmat) # Cook's Distance:Cook and Weisberg(1982): # values greaterthan 1 are troublesome wCook <- which(infReg$cook.d>1) # we're fine here # Average Leverage = (k+1)/n,k - num. of predictors,n - num. observations # Also termed:hat values,range:0 - 1 # see: https://en.wikipedia.org/wiki/Leverage_%28statistics%29 # Various criteria (twice the leverage,three times the average...) wLev <- which(infReg$hat>2*(2/length(iris$price))) # we seem to be fine here too... ## Influenceplot infReg <- as.data.frame(influence.measures(reg)$infmat) plotFrame <- data.frame(residual = resStReg, leverage = infReg$hat, cookD = infReg$cook.d) Infulential Cases + Infulence Plot Intro to R for Data Science Session 6: Linear Regression in R
  • 16. # Introduction to R for Data Science # SESSION 6 :: 02 June, 2016 ggplot(plotFrame, aes(y = residual, x = leverage)) + geom_point(size = plotFrame$cookD*100, shape = 1) + ggtitle("Influence PlotnSize of the circle corresponds to Cook's distance") + theme(plot.title = element_text(size=8, face="bold")) + ylab("Standardized Residual") + xlab("Leverage") Infulence Plot Intro to R for Data Science Session 6: Linear Regression in R
  • 17. Infulence Plot Intro to R for Data Science Session 6: Linear Regression in R