SlideShare a Scribd company logo
1076253 ความน่าจะเป็ นและสถิติ (PROBABILITY AND STATISTICS)
ภาควิชาวิศวกรรมคอมพิวเตอร์ คณะวิศวกรรมศาสตร์
สถาบันเทคโนโลยีพระจอมเกล้าคุณทหารลาดกระบัง
ภาคการเรียนที่ 2 ปี การศึกษา 2558
GAIN IN WEIGHT OF RATS
https://vincentarelbundock.github.io/Rdatasets/doc/HSAUR/weightgain.html
นางสาวฐิติรัตน์ โชคสวัสดิ์ รหัสนักศึกษา 57010354
นางสาวแพรพลอย รัตนากร รหัสนักศึกษา 57010939
 รายละเอียดของข้อมูล
 ค่าพื้นฐานทางสถิติ
 กราฟ
 Histogram
 Polygon
 Cumulative Histogram
 Stem & Leave
 Box Plot
 สรุป
สารบัญ
 แบ่งออกเป็ น 3 column : Source , Type และ Weightgain
 มีทั้งข้อมูลเชิงคุณภาพ และ เชิงปริมาณ
เชิงคุณภาพ : Source , Type
เชิงปริมาณ : Weightgain
 Source ที่พบในข้อมูลดิบ : Beef และ Cereal
 Type ที่พบในข้อมูลดิบ : Low และ High
รายละเอียดของข้อมูล
 ตารางข้อมูล
รายละเอียดของข้อมูล
 ค่าเฉลี่ย ( Mean )
 ใช้คาสั่ง mean(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
ค่าพื้นฐานทางสถิติ
Source Type Mean
Beef Low 79.2
Beef High 100
Cereal Low 83.9
Cereal High 85.9
 ค่ามัธยฐาน ( Median )
 ใช้คาสั่ง median(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
ค่าพื้นฐานทางสถิติ
Source Type Median
Beef Low 82
Beef High 103
Cereal Low 84.5
Cereal High 87
 ค่าฐานนิยม ( Mode )
 ใช้คาสั่ง mode <- function(a=x[m:n,]$weightgain){
+ ux <- unique(a)
+ ux [which.max(tabulate(match(a,ux)))]
+ }
mode()
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
ค่าพื้นฐานทางสถิติ
Source Type Mode
Beef Low 90
Beef High 73
Cereal Low 74
Cereal High 98
 ค่าเบี่ยงเบนมาตรฐาน ( Standard Deviation : SD )
 ใช้คาสั่ง c = sd(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ , c : ประกาศตัวแปรเพื่อเก็บค่าของตัวแปรไว้
ค่าพื้นฐานทางสถิติ
Source Type Standrad Deviation
Beef Low 13.88684
Beef High 15.13642
Cereal Low 15.70881
Cereal High 15.02184
 ค่าต่าสุด และ ค่าสูงสุด ( Minimum and Maximum )
 ใช้คาสั่ง หาค่า minimum : min(x[m:n,]$weightgain)
หาค่า miximum : max(x[m:n,]$weightgain)
หรือ range(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
ค่าพื้นฐานทางสถิติ
Source Type Minimum Maximum
Beef Low 51 95
Beef High 73 118
Cereal Low 58 107
Cereal High 56 111
 Summary
 ใช้คาสั่ง summary(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
ค่าพื้นฐานทางสถิติ
Source Type Minimum 1st Qu. Median Mean 3rd Qu. Maximum
Beef Low 51 73 82 79.2 90 95
Beef High 73 90.25 103 100 110 118
Cereal Low 58 74 84.5 83.9 96.5 107
Cereal High 56 78.25 87 85.9 94.25 111
 Histogram
กราฟ
0
20
40
60
80
100
120
140
1 2 3 4 5 6 7 8 9 10
Weightgain
Frequency
.
Beef/Low
Beef/High
Cereal/Low
Cereal/High
Source/Type
 Histogram
กราฟ
Weightgain : Beef Low
weightgain
Frequency
50 60 70 80 90 100
01234
Weight Gain Frequency
51-60 1
61-70 1
71-80 3
81-90 4
91-100 1
 Histogram
กราฟ
Weight Gain Frequency
71-80 1
81-90 2
91-100 1
101-110 3
111-120 3
Weightgain : Beef High
weightgain
Frequency
70 80 90 100 110 120
0.00.51.01.52.02.53.0
 Histogram
กราฟ
Weight Gain Frequency
50-59 1
60-69 1
70-79 3
80-89 1
90-99 3
100-109 1
Weightgain : Cereal Low
weightgain
Frequency
50 60 70 80 90 100 110
0.00.51.01.52.02.53.0
 Histogram
กราฟ
Weight Gain Frequency
50-59 1
60-69 0
70-79 2
80-89 3
90-99 3
100-109 0
110-119 1
Weightgain : Cereal High
weightgain
Frequency
50 60 70 80 90 100 110 120
0.00.51.01.52.02.53.0
 Histogram
 เปลี่ยนสีแท่งกราฟ
 ใช้คาสั่ง color = c ( “ สี ” , “ สี ” , …. )
 โดยที่สีสามารถ ลงสีได้ 2 รูปแบบ
 พิมพ์ – Red , Orange , Blue , Violet
 พิมพ์ - # แล้วตามด้วยเลข RGB ฐาน 16 จานวน 6 หลัก
 เช่น color = c(“ #FFCCCC “ , “ #FF9999 “ , “ #FF6666 " , “ #FF3333 “ , “ Red " )
วาดกราฟ Histogram
 ใช้คาสั่ง hist( x[m:n,]$weightgain , main = “ ชื่อกราฟ " , col=color , xlab = “ weightgain “ )
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
กราฟ
 Polygon
กราฟ
0
20
40
60
80
100
120
140
0 2 4 6 8 10 12
Weightgain
Frequency
.
Beef/Low
Beef/High
Cereal/Low
Cereal/High
Source/Type
Polygon
 Polygon
 ใช้คาสั่ง plot(x$mids,x$counts,type=“o”,col=“color”,xlim=c(m,n),ann=FALSE)
title(main=“Polygon”)
title(xlab=“Weightgain”)
title(ylab=“Frequency”)
 m = ค่าเริ่มต้นของแกน x , n = ค่าสุดท้ายของแกน x
color = สี หรือ # ตามด้วยเลขฐาน 16 ของ RGB
กราฟ
 Cumulative Histogram
กราฟ
0
200
400
600
800
1000
1200
1 2 3 4 5 6 7 8 9 10 11
Weightgain
Frequency
.
Beef/Low
Beef/High
Cereal/Low
Cereal/High
Source/Type
 Cumulative Histogram
 ใช้คาสั่ง h <- hist(x[m:n,]$weightgain)
h$counts <- cumsum(h&counts)
plot(h,col = “color” , ann=FALSE)
box()
title(main=“Cummulative Histogram” , col.main=“color”)
title(xlab=“Weightgain”)
title(ylab=“Frequency”)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
color = สี หรือ # ตามด้วยเลขฐาน 16 ของ RGB
กราฟ
 Stem & Leave
ใช้คาสั่ง stem(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
Beef Low
กราฟ
5 | 1
6 | 4
7 | 2 6 8
8 | 6
9 | 0 0 0 5
 Stem & Leave
ใช้คาสั่ง stem(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
Beef High
กราฟ
7 | 3
8 | 1 7
10 | 0 2 4 7
11 | 1 7 8
 Stem & Leave
ใช้คาสั่ง stem(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
 Cereal Low
กราฟ
5 | 8
6 | 7
7 | 4 4
8 | 0 9
9 | 5 7 8
10 | 7
 Stem & Leave
ใช้คาสั่ง stem(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
 Cereal High
กราฟ
4 | 6
6 | 4 7
8 | 2 6 8 2 5 8
10 | 1
 Box Plot
ใช้คาสั่ง boxplot(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
Beef Low
กราฟ
 Box Plot
ใช้คาสั่ง boxplot(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
Beef High
กราฟ
 Box Plot
ใช้คาสั่ง boxplot(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
Cereal Low
กราฟ
 Box Plot
ใช้คาสั่ง boxplot(x[m:n,]$weightgain)
 m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ
Cereal High
กราฟ
 พบว่า Beef Low , Beef High , Cereal Low และ Cereal High มีความถี่ที่เท่ากัน
 จากกราฟ Histogram
 ข้อมูล Beef Low มีความถี่สูงสุดอยู่ในช่วง 81-90
 ข้อมูล Beef High มีความถี่สูงสุดในช่วง 101-110 และ 111-120
 ข้อมูล Cereal Low มีความถี่สูงสุดในช่วง 70-79 และ 90-99
 ข้อมูล Cereal High มีความถี่สูงสุดในช่วง 80-89 และ 90-99
 จากกราฟ Box Plot สามารถรู้ค่า ขอบล่างและขอบบนของข้อมูล , ค่ากลางของ
ข้อมูล , ควอไทล์ที่ 1 และ 3 และสามารถรู้ค่า outlier ได้
สรุป

More Related Content

Featured

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Gain in-weight-of-rats

  • 1. 1076253 ความน่าจะเป็ นและสถิติ (PROBABILITY AND STATISTICS) ภาควิชาวิศวกรรมคอมพิวเตอร์ คณะวิศวกรรมศาสตร์ สถาบันเทคโนโลยีพระจอมเกล้าคุณทหารลาดกระบัง ภาคการเรียนที่ 2 ปี การศึกษา 2558 GAIN IN WEIGHT OF RATS https://vincentarelbundock.github.io/Rdatasets/doc/HSAUR/weightgain.html นางสาวฐิติรัตน์ โชคสวัสดิ์ รหัสนักศึกษา 57010354 นางสาวแพรพลอย รัตนากร รหัสนักศึกษา 57010939
  • 2.  รายละเอียดของข้อมูล  ค่าพื้นฐานทางสถิติ  กราฟ  Histogram  Polygon  Cumulative Histogram  Stem & Leave  Box Plot  สรุป สารบัญ
  • 3.  แบ่งออกเป็ น 3 column : Source , Type และ Weightgain  มีทั้งข้อมูลเชิงคุณภาพ และ เชิงปริมาณ เชิงคุณภาพ : Source , Type เชิงปริมาณ : Weightgain  Source ที่พบในข้อมูลดิบ : Beef และ Cereal  Type ที่พบในข้อมูลดิบ : Low และ High รายละเอียดของข้อมูล
  • 5.  ค่าเฉลี่ย ( Mean )  ใช้คาสั่ง mean(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ ค่าพื้นฐานทางสถิติ Source Type Mean Beef Low 79.2 Beef High 100 Cereal Low 83.9 Cereal High 85.9
  • 6.  ค่ามัธยฐาน ( Median )  ใช้คาสั่ง median(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ ค่าพื้นฐานทางสถิติ Source Type Median Beef Low 82 Beef High 103 Cereal Low 84.5 Cereal High 87
  • 7.  ค่าฐานนิยม ( Mode )  ใช้คาสั่ง mode <- function(a=x[m:n,]$weightgain){ + ux <- unique(a) + ux [which.max(tabulate(match(a,ux)))] + } mode()  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ ค่าพื้นฐานทางสถิติ Source Type Mode Beef Low 90 Beef High 73 Cereal Low 74 Cereal High 98
  • 8.  ค่าเบี่ยงเบนมาตรฐาน ( Standard Deviation : SD )  ใช้คาสั่ง c = sd(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ , c : ประกาศตัวแปรเพื่อเก็บค่าของตัวแปรไว้ ค่าพื้นฐานทางสถิติ Source Type Standrad Deviation Beef Low 13.88684 Beef High 15.13642 Cereal Low 15.70881 Cereal High 15.02184
  • 9.  ค่าต่าสุด และ ค่าสูงสุด ( Minimum and Maximum )  ใช้คาสั่ง หาค่า minimum : min(x[m:n,]$weightgain) หาค่า miximum : max(x[m:n,]$weightgain) หรือ range(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ ค่าพื้นฐานทางสถิติ Source Type Minimum Maximum Beef Low 51 95 Beef High 73 118 Cereal Low 58 107 Cereal High 56 111
  • 10.  Summary  ใช้คาสั่ง summary(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ ค่าพื้นฐานทางสถิติ Source Type Minimum 1st Qu. Median Mean 3rd Qu. Maximum Beef Low 51 73 82 79.2 90 95 Beef High 73 90.25 103 100 110 118 Cereal Low 58 74 84.5 83.9 96.5 107 Cereal High 56 78.25 87 85.9 94.25 111
  • 11.  Histogram กราฟ 0 20 40 60 80 100 120 140 1 2 3 4 5 6 7 8 9 10 Weightgain Frequency . Beef/Low Beef/High Cereal/Low Cereal/High Source/Type
  • 12.  Histogram กราฟ Weightgain : Beef Low weightgain Frequency 50 60 70 80 90 100 01234 Weight Gain Frequency 51-60 1 61-70 1 71-80 3 81-90 4 91-100 1
  • 13.  Histogram กราฟ Weight Gain Frequency 71-80 1 81-90 2 91-100 1 101-110 3 111-120 3 Weightgain : Beef High weightgain Frequency 70 80 90 100 110 120 0.00.51.01.52.02.53.0
  • 14.  Histogram กราฟ Weight Gain Frequency 50-59 1 60-69 1 70-79 3 80-89 1 90-99 3 100-109 1 Weightgain : Cereal Low weightgain Frequency 50 60 70 80 90 100 110 0.00.51.01.52.02.53.0
  • 15.  Histogram กราฟ Weight Gain Frequency 50-59 1 60-69 0 70-79 2 80-89 3 90-99 3 100-109 0 110-119 1 Weightgain : Cereal High weightgain Frequency 50 60 70 80 90 100 110 120 0.00.51.01.52.02.53.0
  • 16.  Histogram  เปลี่ยนสีแท่งกราฟ  ใช้คาสั่ง color = c ( “ สี ” , “ สี ” , …. )  โดยที่สีสามารถ ลงสีได้ 2 รูปแบบ  พิมพ์ – Red , Orange , Blue , Violet  พิมพ์ - # แล้วตามด้วยเลข RGB ฐาน 16 จานวน 6 หลัก  เช่น color = c(“ #FFCCCC “ , “ #FF9999 “ , “ #FF6666 " , “ #FF3333 “ , “ Red " ) วาดกราฟ Histogram  ใช้คาสั่ง hist( x[m:n,]$weightgain , main = “ ชื่อกราฟ " , col=color , xlab = “ weightgain “ )  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ กราฟ
  • 17.  Polygon กราฟ 0 20 40 60 80 100 120 140 0 2 4 6 8 10 12 Weightgain Frequency . Beef/Low Beef/High Cereal/Low Cereal/High Source/Type Polygon
  • 18.  Polygon  ใช้คาสั่ง plot(x$mids,x$counts,type=“o”,col=“color”,xlim=c(m,n),ann=FALSE) title(main=“Polygon”) title(xlab=“Weightgain”) title(ylab=“Frequency”)  m = ค่าเริ่มต้นของแกน x , n = ค่าสุดท้ายของแกน x color = สี หรือ # ตามด้วยเลขฐาน 16 ของ RGB กราฟ
  • 19.  Cumulative Histogram กราฟ 0 200 400 600 800 1000 1200 1 2 3 4 5 6 7 8 9 10 11 Weightgain Frequency . Beef/Low Beef/High Cereal/Low Cereal/High Source/Type
  • 20.  Cumulative Histogram  ใช้คาสั่ง h <- hist(x[m:n,]$weightgain) h$counts <- cumsum(h&counts) plot(h,col = “color” , ann=FALSE) box() title(main=“Cummulative Histogram” , col.main=“color”) title(xlab=“Weightgain”) title(ylab=“Frequency”)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ color = สี หรือ # ตามด้วยเลขฐาน 16 ของ RGB กราฟ
  • 21.  Stem & Leave ใช้คาสั่ง stem(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ Beef Low กราฟ 5 | 1 6 | 4 7 | 2 6 8 8 | 6 9 | 0 0 0 5
  • 22.  Stem & Leave ใช้คาสั่ง stem(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ Beef High กราฟ 7 | 3 8 | 1 7 10 | 0 2 4 7 11 | 1 7 8
  • 23.  Stem & Leave ใช้คาสั่ง stem(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ  Cereal Low กราฟ 5 | 8 6 | 7 7 | 4 4 8 | 0 9 9 | 5 7 8 10 | 7
  • 24.  Stem & Leave ใช้คาสั่ง stem(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ  Cereal High กราฟ 4 | 6 6 | 4 7 8 | 2 6 8 2 5 8 10 | 1
  • 25.  Box Plot ใช้คาสั่ง boxplot(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ Beef Low กราฟ
  • 26.  Box Plot ใช้คาสั่ง boxplot(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ Beef High กราฟ
  • 27.  Box Plot ใช้คาสั่ง boxplot(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ Cereal Low กราฟ
  • 28.  Box Plot ใช้คาสั่ง boxplot(x[m:n,]$weightgain)  m : แถวเริ่มต้นในการคานวณ , n : แถวสุดท้ายในการคานวณ Cereal High กราฟ
  • 29.  พบว่า Beef Low , Beef High , Cereal Low และ Cereal High มีความถี่ที่เท่ากัน  จากกราฟ Histogram  ข้อมูล Beef Low มีความถี่สูงสุดอยู่ในช่วง 81-90  ข้อมูล Beef High มีความถี่สูงสุดในช่วง 101-110 และ 111-120  ข้อมูล Cereal Low มีความถี่สูงสุดในช่วง 70-79 และ 90-99  ข้อมูล Cereal High มีความถี่สูงสุดในช่วง 80-89 และ 90-99  จากกราฟ Box Plot สามารถรู้ค่า ขอบล่างและขอบบนของข้อมูล , ค่ากลางของ ข้อมูล , ควอไทล์ที่ 1 และ 3 และสามารถรู้ค่า outlier ได้ สรุป