SlideShare a Scribd company logo
1 of 14
Download to read offline
Line Up, Please
 the data do not fit the line precisely.
 The graph shows how the relationship
between an input variable – on the horizontal
x axis – relates to the output values on the y
axis.
 The mathematical idea that allows us to fit
lines of best fit to a set of data points like this
is that we can find a position for the line that
will minimize the distance the line is from all
the points.
Notices on the graph
The data are available from a website (OzDasl) at
:http://www.statsci.org/data/oz/afl.html.
The variable of interest is MCG attendance related
with independent variables include club
membership, weather on match day, date of match,
this what makes football fans decide whether or
not to go to a game , Use this command to find out
what the current working directory is:
> getwd()
read the data set into R as follows:
> attend<-read.delim("afl.txt", header=TRUE)
> attach(attend)
Football
or
Rugby?
Getting the Data
Scatterplot of membership versus attendance
> plot(MCG ~ Members, xlab = "Combined membership of teams
playing", ylab = "MCG Match Day Attendance"
We see evidence of a trend in the
points on the left hand side of the
graph, and a small group of points
representing games with very high
combined membership but that don’t
seem to fit the trend applying to the
rest of data. If it wasn’t for the four
"outliers" on the right hand side of the
plot, we would be left with a plot
showing a very strong relationship.
This model essentially saying that if
the two teams are so unpopular they
don’t have any members, no one will
go to see their matches, and vice
versa.
we can use R to create a linear model for MCG attendance
using the combined membership as the single explanatory
 creates a nice big data structure
full of output using lm() command
> model1 <- lm(MCG ~ Members-1)
 summary() command we request
an overview of the contents of
model1.
> summary(model1)
 the proportion of the variation which is accounted for in the
dependent variable by the whole set of independent variables .
 An r-squared value of 1.0 would mean that the X variable(s), the
independent variable(s), perfectly predicted the y, or dependent.
 An r-squared value of zero would indicated that the x variable(s)
did not predict the y variable at all variable.
 The r-squared of.8847 in this example means that the Combined
Members variable account for 88.47% of the MCG attendance
variable, an excellent result.
 R-squared cannot be negative.
 there is no absolute rule for what makes an r squared good. Much
depends on the purpose of the analysis. In the analysis of human
behavior, which is notoriously unpredictable, an r-squared of .20 or
.30 may be very good.
r squared value (coefficient of determination)
a line of best fit based on the model to
the x-y plot of MCG attendance
against total team membership.
 abline(model1)
While the line of best fit seems to fit
the points in the middle, the points on
the lower right hand side and also
some points towards the top of the
graph, appear to be a long way from
the line of best fit.
Adding Another Independent Variable
need to make a significant interstate
journey to see their team play at the
MCG(by plane, train,..etc).
new ‘Away team is interstate variable,
we can use this variable to create a
new linear regression
model that includes two independent
variables.
> model2<- lm(MCG~Members+away.inter-1)
> summary(model2)
Notes
 the r-squared value is now 0.9246, which is quite a bit higher than the 0.8847 that
we observed in the previous model.
 the two independent variables working together account for 92.46% of the
dependent variable. So together, the total fan base and the status as an away team
are doing a really great job of predicting attendance.
 more likely to come to games if they’re a moderate car ride away, compared to a
plane journey.
 there is heading that says "Estimate." that are slope values for Members and for
away.inter. Notice that the slope (sometimes called a "B-weight") on Members is
positive,this makes sense because the more fans the team has the higher the
attendance. The slope on away.inter is negative because when this variable is 1 (in
the case of interstate teams) the attendance is lower) whereas when this variable is
0 (for local teams), attendance is higher.
T value
• to predict if these slopes or B-weights are actually important
contributors .It comes from divide the unstandardized B-weight by its
standard .if this t value has an absolute value (i.e., ignoring the minus
sign if there is one) that is larger than about 2,you can be assured
that the independent/predictor variable we are talking about is
contributing to the prediction of the dependent variable.
• In the past example we can see that Members has a humongous
T value of 21.257, showing that it is very important in the prediction.
The away .inter variable has a somewhat more modest, but
still important value of -4.545 .
actual prediction equation
It uses the estimates/B-weights from the output:
MCG = (21.257 * Members) - ( 4.545 * away.inter)
This equation would let us predict the attendance of any game with a
good degree of accuracy.
statisticians are rarely interested in using prediction equations like
above.They are generally more interested in just knowing that a
predictor is important or unimportant.
You must be careful with using the slopes/B-weights obtained from a
linear regression of a single sample, because they are likely to change if
another sample is analyzed - just because of the forces of randomness.
Thank
you

More Related Content

What's hot

(8) Lesson 9.2
(8) Lesson 9.2(8) Lesson 9.2
(8) Lesson 9.2wzuri
 
Data Science: Prediction analysis for houses in Ames, Iowa.
Data Science: Prediction analysis for houses in Ames, Iowa.Data Science: Prediction analysis for houses in Ames, Iowa.
Data Science: Prediction analysis for houses in Ames, Iowa.ASHISH MENKUDALE
 
Scale development -- Reliability
Scale development -- ReliabilityScale development -- Reliability
Scale development -- ReliabilityKhalid Mahmood
 
Correspondence analysis final
Correspondence analysis finalCorrespondence analysis final
Correspondence analysis finalsaba khan
 
Difference between Vector Quantization and Scalar Quantization
Difference between Vector Quantization and Scalar QuantizationDifference between Vector Quantization and Scalar Quantization
Difference between Vector Quantization and Scalar QuantizationHimanshuSirohi6
 
Advantages of vector quantization over scalar quantization (1)
Advantages of vector quantization over scalar quantization (1)Advantages of vector quantization over scalar quantization (1)
Advantages of vector quantization over scalar quantization (1)HimanshuSirohi6
 
Vector Quantization Vs Scalar Quantization
Vector Quantization Vs Scalar Quantization Vector Quantization Vs Scalar Quantization
Vector Quantization Vs Scalar Quantization ManasiKaur
 
CORRELATION OF EIGENVECTOR CENTRALITY TO OTHER CENTRALITY MEASURES: RANDOM, S...
CORRELATION OF EIGENVECTOR CENTRALITY TO OTHER CENTRALITY MEASURES: RANDOM, S...CORRELATION OF EIGENVECTOR CENTRALITY TO OTHER CENTRALITY MEASURES: RANDOM, S...
CORRELATION OF EIGENVECTOR CENTRALITY TO OTHER CENTRALITY MEASURES: RANDOM, S...csandit
 
1-7 Presenting Data
1-7 Presenting Data1-7 Presenting Data
1-7 Presenting Datarkelch
 
Machine learning session 10
Machine learning session 10Machine learning session 10
Machine learning session 10NirsandhG
 
Implement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratchImplement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratchEshanAgarwal4
 
Logistic Regression with R
Logistic Regression with RLogistic Regression with R
Logistic Regression with RJerome Gomes
 
Slides distancecovariance
Slides distancecovarianceSlides distancecovariance
Slides distancecovarianceShrey Nishchal
 
breadth first search
breadth first searchbreadth first search
breadth first searchDeepikaT13
 
MS Excel functions
MS Excel functionsMS Excel functions
MS Excel functionsameermudasar
 

What's hot (19)

(8) Lesson 9.2
(8) Lesson 9.2(8) Lesson 9.2
(8) Lesson 9.2
 
Data Science: Prediction analysis for houses in Ames, Iowa.
Data Science: Prediction analysis for houses in Ames, Iowa.Data Science: Prediction analysis for houses in Ames, Iowa.
Data Science: Prediction analysis for houses in Ames, Iowa.
 
Scale development -- Reliability
Scale development -- ReliabilityScale development -- Reliability
Scale development -- Reliability
 
Correspondence analysis final
Correspondence analysis finalCorrespondence analysis final
Correspondence analysis final
 
GMM
GMMGMM
GMM
 
Difference between Vector Quantization and Scalar Quantization
Difference between Vector Quantization and Scalar QuantizationDifference between Vector Quantization and Scalar Quantization
Difference between Vector Quantization and Scalar Quantization
 
Advantages of vector quantization over scalar quantization (1)
Advantages of vector quantization over scalar quantization (1)Advantages of vector quantization over scalar quantization (1)
Advantages of vector quantization over scalar quantization (1)
 
Vector Quantization Vs Scalar Quantization
Vector Quantization Vs Scalar Quantization Vector Quantization Vs Scalar Quantization
Vector Quantization Vs Scalar Quantization
 
Matrices
MatricesMatrices
Matrices
 
CORRELATION OF EIGENVECTOR CENTRALITY TO OTHER CENTRALITY MEASURES: RANDOM, S...
CORRELATION OF EIGENVECTOR CENTRALITY TO OTHER CENTRALITY MEASURES: RANDOM, S...CORRELATION OF EIGENVECTOR CENTRALITY TO OTHER CENTRALITY MEASURES: RANDOM, S...
CORRELATION OF EIGENVECTOR CENTRALITY TO OTHER CENTRALITY MEASURES: RANDOM, S...
 
1-7 Presenting Data
1-7 Presenting Data1-7 Presenting Data
1-7 Presenting Data
 
CENTRALITY OF GRAPH ON DIFFERENT NETWORK TOPOLOGIES
CENTRALITY OF GRAPH ON DIFFERENT NETWORK TOPOLOGIESCENTRALITY OF GRAPH ON DIFFERENT NETWORK TOPOLOGIES
CENTRALITY OF GRAPH ON DIFFERENT NETWORK TOPOLOGIES
 
Machine learning session 10
Machine learning session 10Machine learning session 10
Machine learning session 10
 
Implement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratchImplement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratch
 
Logistic Regression with R
Logistic Regression with RLogistic Regression with R
Logistic Regression with R
 
MATCHING GRAPH THEORY
MATCHING GRAPH THEORYMATCHING GRAPH THEORY
MATCHING GRAPH THEORY
 
Slides distancecovariance
Slides distancecovarianceSlides distancecovariance
Slides distancecovariance
 
breadth first search
breadth first searchbreadth first search
breadth first search
 
MS Excel functions
MS Excel functionsMS Excel functions
MS Excel functions
 

Similar to Line uo,please

Exploring bivariate data
Exploring bivariate dataExploring bivariate data
Exploring bivariate dataUlster BOCES
 
SupportVectorRegression
SupportVectorRegressionSupportVectorRegression
SupportVectorRegressionDaniel K
 
Exploring Support Vector Regression - Signals and Systems Project
Exploring Support Vector Regression - Signals and Systems ProjectExploring Support Vector Regression - Signals and Systems Project
Exploring Support Vector Regression - Signals and Systems ProjectSurya Chandra
 
Machine learning session4(linear regression)
Machine learning   session4(linear regression)Machine learning   session4(linear regression)
Machine learning session4(linear regression)Abhimanyu Dwivedi
 
Regression kriging
Regression krigingRegression kriging
Regression krigingFAO
 
Measuring Robustness on Generalized Gaussian Distribution
Measuring Robustness on Generalized Gaussian DistributionMeasuring Robustness on Generalized Gaussian Distribution
Measuring Robustness on Generalized Gaussian DistributionIJERA Editor
 
Lecture7a Applied Econometrics and Economic Modeling
Lecture7a Applied Econometrics and Economic ModelingLecture7a Applied Econometrics and Economic Modeling
Lecture7a Applied Econometrics and Economic Modelingstone55
 
Predicting US house prices using Multiple Linear Regression in R
Predicting US house prices using Multiple Linear Regression in RPredicting US house prices using Multiple Linear Regression in R
Predicting US house prices using Multiple Linear Regression in RSotiris Baratsas
 
4.3 Fitting Linear Models to Data
4.3 Fitting Linear Models to Data4.3 Fitting Linear Models to Data
4.3 Fitting Linear Models to Datasmiller5
 
Linear functions and modeling
Linear functions and modelingLinear functions and modeling
Linear functions and modelingIVY SOLIS
 
Guide for building GLMS
Guide for building GLMSGuide for building GLMS
Guide for building GLMSAli T. Lotia
 
Correlation and regression
Correlation and regressionCorrelation and regression
Correlation and regressionOmi Shah
 
Jgrass-NewAge: Kriging component
Jgrass-NewAge: Kriging componentJgrass-NewAge: Kriging component
Jgrass-NewAge: Kriging componentNiccolò Tubini
 
3. frequency distribution
3. frequency distribution3. frequency distribution
3. frequency distributionIlham Bashir
 
Linear regression
Linear regressionLinear regression
Linear regressionDepEd
 

Similar to Line uo,please (20)

Exploring bivariate data
Exploring bivariate dataExploring bivariate data
Exploring bivariate data
 
Chapter05
Chapter05Chapter05
Chapter05
 
SupportVectorRegression
SupportVectorRegressionSupportVectorRegression
SupportVectorRegression
 
Exploring Support Vector Regression - Signals and Systems Project
Exploring Support Vector Regression - Signals and Systems ProjectExploring Support Vector Regression - Signals and Systems Project
Exploring Support Vector Regression - Signals and Systems Project
 
working with python
working with pythonworking with python
working with python
 
Machine learning session4(linear regression)
Machine learning   session4(linear regression)Machine learning   session4(linear regression)
Machine learning session4(linear regression)
 
Regression kriging
Regression krigingRegression kriging
Regression kriging
 
Measuring Robustness on Generalized Gaussian Distribution
Measuring Robustness on Generalized Gaussian DistributionMeasuring Robustness on Generalized Gaussian Distribution
Measuring Robustness on Generalized Gaussian Distribution
 
Lecture7a Applied Econometrics and Economic Modeling
Lecture7a Applied Econometrics and Economic ModelingLecture7a Applied Econometrics and Economic Modeling
Lecture7a Applied Econometrics and Economic Modeling
 
Predicting US house prices using Multiple Linear Regression in R
Predicting US house prices using Multiple Linear Regression in RPredicting US house prices using Multiple Linear Regression in R
Predicting US house prices using Multiple Linear Regression in R
 
4.3 Fitting Linear Models to Data
4.3 Fitting Linear Models to Data4.3 Fitting Linear Models to Data
4.3 Fitting Linear Models to Data
 
Linear functions and modeling
Linear functions and modelingLinear functions and modeling
Linear functions and modeling
 
Simple linear regression
Simple linear regressionSimple linear regression
Simple linear regression
 
Correlation and regression in r
Correlation and regression in rCorrelation and regression in r
Correlation and regression in r
 
Guide for building GLMS
Guide for building GLMSGuide for building GLMS
Guide for building GLMS
 
Correlation and regression
Correlation and regressionCorrelation and regression
Correlation and regression
 
Jgrass-NewAge: Kriging component
Jgrass-NewAge: Kriging componentJgrass-NewAge: Kriging component
Jgrass-NewAge: Kriging component
 
R nonlinear least square
R   nonlinear least squareR   nonlinear least square
R nonlinear least square
 
3. frequency distribution
3. frequency distribution3. frequency distribution
3. frequency distribution
 
Linear regression
Linear regressionLinear regression
Linear regression
 

More from heba_ahmad

heba alsayed ahmad_Recomm_#
heba alsayed ahmad_Recomm_#heba alsayed ahmad_Recomm_#
heba alsayed ahmad_Recomm_#heba_ahmad
 
heba alsayed ahmad_Recomm_#2
heba alsayed ahmad_Recomm_#2heba alsayed ahmad_Recomm_#2
heba alsayed ahmad_Recomm_#2heba_ahmad
 
bassel alkhatib recommendation
bassel alkhatib recommendation bassel alkhatib recommendation
bassel alkhatib recommendation heba_ahmad
 
recommendation dr jose
recommendation dr joserecommendation dr jose
recommendation dr joseheba_ahmad
 
recommendation dr.miguel
recommendation dr.miguelrecommendation dr.miguel
recommendation dr.miguelheba_ahmad
 
metaheuristic tabu pso
metaheuristic tabu psometaheuristic tabu pso
metaheuristic tabu psoheba_ahmad
 
Introduction to data science intro,ch(1,2,3)
Introduction to data science intro,ch(1,2,3)Introduction to data science intro,ch(1,2,3)
Introduction to data science intro,ch(1,2,3)heba_ahmad
 
&Final presentation
 &Final presentation &Final presentation
&Final presentationheba_ahmad
 
Final presentation
Final presentationFinal presentation
Final presentationheba_ahmad
 

More from heba_ahmad (13)

heba alsayed ahmad_Recomm_#
heba alsayed ahmad_Recomm_#heba alsayed ahmad_Recomm_#
heba alsayed ahmad_Recomm_#
 
heba alsayed ahmad_Recomm_#2
heba alsayed ahmad_Recomm_#2heba alsayed ahmad_Recomm_#2
heba alsayed ahmad_Recomm_#2
 
bassel alkhatib recommendation
bassel alkhatib recommendation bassel alkhatib recommendation
bassel alkhatib recommendation
 
recommendation dr jose
recommendation dr joserecommendation dr jose
recommendation dr jose
 
recommendation dr.miguel
recommendation dr.miguelrecommendation dr.miguel
recommendation dr.miguel
 
metaheuristic tabu pso
metaheuristic tabu psometaheuristic tabu pso
metaheuristic tabu pso
 
Data mining
Data miningData mining
Data mining
 
Introduction to data science intro,ch(1,2,3)
Introduction to data science intro,ch(1,2,3)Introduction to data science intro,ch(1,2,3)
Introduction to data science intro,ch(1,2,3)
 
Shiny in R
Shiny in RShiny in R
Shiny in R
 
&Final presentation
 &Final presentation &Final presentation
&Final presentation
 
Chapter 18,19
Chapter 18,19Chapter 18,19
Chapter 18,19
 
Ggplot2 ch2
Ggplot2 ch2Ggplot2 ch2
Ggplot2 ch2
 
Final presentation
Final presentationFinal presentation
Final presentation
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 

Line uo,please

  • 2.
  • 3.
  • 4.  the data do not fit the line precisely.  The graph shows how the relationship between an input variable – on the horizontal x axis – relates to the output values on the y axis.  The mathematical idea that allows us to fit lines of best fit to a set of data points like this is that we can find a position for the line that will minimize the distance the line is from all the points. Notices on the graph
  • 5. The data are available from a website (OzDasl) at :http://www.statsci.org/data/oz/afl.html. The variable of interest is MCG attendance related with independent variables include club membership, weather on match day, date of match, this what makes football fans decide whether or not to go to a game , Use this command to find out what the current working directory is: > getwd() read the data set into R as follows: > attend<-read.delim("afl.txt", header=TRUE) > attach(attend) Football or Rugby? Getting the Data
  • 6. Scatterplot of membership versus attendance > plot(MCG ~ Members, xlab = "Combined membership of teams playing", ylab = "MCG Match Day Attendance" We see evidence of a trend in the points on the left hand side of the graph, and a small group of points representing games with very high combined membership but that don’t seem to fit the trend applying to the rest of data. If it wasn’t for the four "outliers" on the right hand side of the plot, we would be left with a plot showing a very strong relationship. This model essentially saying that if the two teams are so unpopular they don’t have any members, no one will go to see their matches, and vice versa.
  • 7. we can use R to create a linear model for MCG attendance using the combined membership as the single explanatory  creates a nice big data structure full of output using lm() command > model1 <- lm(MCG ~ Members-1)  summary() command we request an overview of the contents of model1. > summary(model1)
  • 8.  the proportion of the variation which is accounted for in the dependent variable by the whole set of independent variables .  An r-squared value of 1.0 would mean that the X variable(s), the independent variable(s), perfectly predicted the y, or dependent.  An r-squared value of zero would indicated that the x variable(s) did not predict the y variable at all variable.  The r-squared of.8847 in this example means that the Combined Members variable account for 88.47% of the MCG attendance variable, an excellent result.  R-squared cannot be negative.  there is no absolute rule for what makes an r squared good. Much depends on the purpose of the analysis. In the analysis of human behavior, which is notoriously unpredictable, an r-squared of .20 or .30 may be very good. r squared value (coefficient of determination)
  • 9. a line of best fit based on the model to the x-y plot of MCG attendance against total team membership.  abline(model1) While the line of best fit seems to fit the points in the middle, the points on the lower right hand side and also some points towards the top of the graph, appear to be a long way from the line of best fit.
  • 10. Adding Another Independent Variable need to make a significant interstate journey to see their team play at the MCG(by plane, train,..etc). new ‘Away team is interstate variable, we can use this variable to create a new linear regression model that includes two independent variables. > model2<- lm(MCG~Members+away.inter-1) > summary(model2)
  • 11. Notes  the r-squared value is now 0.9246, which is quite a bit higher than the 0.8847 that we observed in the previous model.  the two independent variables working together account for 92.46% of the dependent variable. So together, the total fan base and the status as an away team are doing a really great job of predicting attendance.  more likely to come to games if they’re a moderate car ride away, compared to a plane journey.  there is heading that says "Estimate." that are slope values for Members and for away.inter. Notice that the slope (sometimes called a "B-weight") on Members is positive,this makes sense because the more fans the team has the higher the attendance. The slope on away.inter is negative because when this variable is 1 (in the case of interstate teams) the attendance is lower) whereas when this variable is 0 (for local teams), attendance is higher.
  • 12. T value • to predict if these slopes or B-weights are actually important contributors .It comes from divide the unstandardized B-weight by its standard .if this t value has an absolute value (i.e., ignoring the minus sign if there is one) that is larger than about 2,you can be assured that the independent/predictor variable we are talking about is contributing to the prediction of the dependent variable. • In the past example we can see that Members has a humongous T value of 21.257, showing that it is very important in the prediction. The away .inter variable has a somewhat more modest, but still important value of -4.545 .
  • 13. actual prediction equation It uses the estimates/B-weights from the output: MCG = (21.257 * Members) - ( 4.545 * away.inter) This equation would let us predict the attendance of any game with a good degree of accuracy. statisticians are rarely interested in using prediction equations like above.They are generally more interested in just knowing that a predictor is important or unimportant. You must be careful with using the slopes/B-weights obtained from a linear regression of a single sample, because they are likely to change if another sample is analyzed - just because of the forces of randomness.