SlideShare a Scribd company logo
1 of 10
Download to read offline
0 | 00000000000000000000000000000000000000000000000000000000000000000000
0 |
1 | 000000000000000000
1 |
2 | 000
2 |
3 | 0
0.00.51.01.52.02.53.0
Histogram of Number.of.Crimes
Number.of.Crimes
Frequency
0.0 0.5 1.0 1.5 2.0 2.5 3.0
010203040506070
0 1 2 3 4 5 6 7 8 9
Strongarm Robbery
Aggravated Assault/Battery-Other Weapon
Burglary
Simple Assault/Battery
Theft of Automobile
Number of Crimes by Type
myfile=read.table(file="Project.csv", sep=",", header=TRUE)
> myfile
Day Number.of.Crimes
1 7/19/2015 0
2 7/20/2015 0
3 7/21/2015 1
4 7/22/2015 0
5 7/23/2015 0
6 7/24/2015 0
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5 12am
1am
2am
3am
4am
5am
6am
7am
8am
9am
10am
11am
12pm
1pm
2pm
3pm
4pm
5pm
6pm
7pm
8pm
9pm
10pm
11pm
Number of Crimes by Time of Day
0
0.5
1
1.5
2
2.5
Number of Crimes Per Location
7 7/25/2015 1
8 7/26/2015 0
9 7/27/2015 0
10 7/28/2015 1
11 7/29/2015 1
12 7/30/2015 0
13 7/31/2015 1
14 8/1/2015 0
15 8/2/2015 0
16 8/3/2015 1
17 8/4/2015 0
18 8/5/2015 1
19 8/6/2015 0
20 8/7/2015 0
21 8/8/2015 0
22 8/9/2015 0
23 8/10/2015 0
24 8/11/2015 0
25 8/12/2015 0
26 8/13/2015 0
27 8/14/2015 1
28 8/15/2015 0
29 8/16/2015 0
30 8/17/2015 0
31 8/18/2015 1
32 8/19/2015 0
33 8/20/2015 0
34 8/21/2015 0
35 8/22/2015 2
36 8/23/2015 1
37 8/24/2015 0
38 8/25/2015 0
39 8/26/2015 0
40 8/27/2015 0
41 8/28/2015 0
42 8/29/2015 0
43 8/30/2015 0
44 8/31/2015 0
45 9/1/2015 1
46 9/2/2015 0
47 9/3/2015 0
48 9/4/2015 0
49 9/5/2015 0
50 9/6/2015 0
51 9/7/2015 2
52 9/8/2015 0
53 9/9/2015 0
54 9/10/2015 0
55 9/11/2015 0
56 9/12/2015 0
57 9/13/2015 0
58 9/14/2015 0
59 9/15/2015 0
60 9/16/2015 1
61 9/17/2015 0
62 9/18/2015 0
63 9/19/2015 1
64 9/20/2015 0
65 9/21/2015 0
66 9/22/2015 0
67 9/23/2015 0
68 9/24/2015 0
69 9/25/2015 0
70 9/26/2015 1
71 9/27/2015 0
72 9/28/2015 0
73 9/29/2015 0
74 9/30/2015 0
75 10/1/2015 1
76 10/2/2015 3
77 10/3/2015 0
78 10/4/2015 0
79 10/5/2015 1
80 10/6/2015 1
81 10/7/2015 1
82 10/8/2015 0
83 10/9/2015 0
84 10/10/2015 2
85 10/11/2015 0
86 10/12/2015 0
87 10/13/2015 0
88 10/14/2015 0
89 10/15/2015 0
90 10/16/2015 0
> summary(myfile)
Day Number.of.Crimes
10/1/2015 : 1 Min. :0.0
10/10/2015: 1 1st Qu.:0.0
10/11/2015: 1 Median :0.0
10/12/2015: 1 Mean :0.3
10/13/2015: 1 3rd Qu.:0.0
10/14/2015: 1 Max. :3.0
(Other) :84
> names(myfile)
[1] "Day" "Number.of.Crimes"
> attach(myfile)
> names(myfile)
[1] "Day" "Number.of.Crimes"
> hist(Number.of.Crimes, main="Number of Crimes(Burglary, Strongarm Robbery,
SimpleAssault/Battery, Theft of Automobile)")
> boxplot(Number.of.Crimes)
> stem(Number.of.Crimes)
The decimal point is at the |
0 | 00000000000000000000000000000000000000000000000000000000000000000000
0 |
1 | 000000000000000000
1 |
2 | 000
2 |
3 | 0
> var(Number.of.Crimes)
[1] 0.347191
> sd(Number.of.Crimes)
[1] 0.5892292
> length(Number.of.Crimes)
[1] 90
> t1.t.test(Number.of.Crimes, conf.level=0.90)
Error: could not find function "t1.t.test"
> t1=t.test(Number.of.Crimes, conf.level=0.90)
> t2=t.test(Number.of.Crimes, conf.level=0.95)
> t3=t.test(Number.of.Crimes, conf.level=0.99)
> t4=t.test(Number.of.Crimes, conf.level=1)
> t1
One Sample t-test
data: Number.of.Crimes
t = 4.8301, df = 89, p-value = 5.642e-06
alternative hypothesis: true mean is not equal to 0
90 percent confidence interval:
0.1967632 0.4032368
sample estimates:
mean of x
0.3
> t2
One Sample t-test
data: Number.of.Crimes
t = 4.8301, df = 89, p-value = 5.642e-06
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
0.1765883 0.4234117
sample estimates:
mean of x
0.3
> t3
One Sample t-test
data: Number.of.Crimes
t = 4.8301, df = 89, p-value = 5.642e-06
alternative hypothesis: true mean is not equal to 0
99 percent confidence interval:
0.1365133 0.4634867
sample estimates:
mean of x
0.3
> t4
One Sample t-test
data: Number.of.Crimes
t = 4.8301, df = 89, p-value = 5.642e-06
alternative hypothesis: true mean is not equal to 0
100 percent confidence interval:
-Inf Inf
sample estimates:
mean of x
0.3
> ppois(0, lambda=0.3, lower=FALSE)
[1] 0.2591818
> dpois(2:7, lambda=0.3, lower=FALSE)
Error in dpois(2:7, lambda = 0.3, lower = FALSE) :
unused argument (lower = FALSE)
> dpois(2:7, lambda=0.3)
[1] 3.333682e-02 3.333682e-03 2.500261e-04 1.500157e-05 7.500784e-07
[6] 3.214622e-08
> dpois(1, lambda=1/24)
[1] 0.03996623
> hist(Number.of.Crimes)
> dpois(1:3, lambda=0.3,)
[1] 0.222245466 0.033336820 0.003333682
> dpois(1:3, lambda=0.3)
[1] 0.222245466 0.033336820 0.003333682
> getwd()
[1] "C:/Users/Kaba/Documents"
> boxplot(Number.of.Crimes)

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
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 2024Neil 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 2024Albert 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 InsightsKurio // 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 2024Search 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 summarySpeakerHub
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit 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 managementMindGenius
 
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
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
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...
 

kaba_ousmane_finalreportRcode.pdf

  • 1. 0 | 00000000000000000000000000000000000000000000000000000000000000000000 0 | 1 | 000000000000000000 1 | 2 | 000 2 | 3 | 0 0.00.51.01.52.02.53.0
  • 2. Histogram of Number.of.Crimes Number.of.Crimes Frequency 0.0 0.5 1.0 1.5 2.0 2.5 3.0 010203040506070 0 1 2 3 4 5 6 7 8 9 Strongarm Robbery Aggravated Assault/Battery-Other Weapon Burglary Simple Assault/Battery Theft of Automobile Number of Crimes by Type
  • 3. myfile=read.table(file="Project.csv", sep=",", header=TRUE) > myfile Day Number.of.Crimes 1 7/19/2015 0 2 7/20/2015 0 3 7/21/2015 1 4 7/22/2015 0 5 7/23/2015 0 6 7/24/2015 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 12am 1am 2am 3am 4am 5am 6am 7am 8am 9am 10am 11am 12pm 1pm 2pm 3pm 4pm 5pm 6pm 7pm 8pm 9pm 10pm 11pm Number of Crimes by Time of Day 0 0.5 1 1.5 2 2.5 Number of Crimes Per Location
  • 4. 7 7/25/2015 1 8 7/26/2015 0 9 7/27/2015 0 10 7/28/2015 1 11 7/29/2015 1 12 7/30/2015 0 13 7/31/2015 1 14 8/1/2015 0 15 8/2/2015 0 16 8/3/2015 1 17 8/4/2015 0 18 8/5/2015 1 19 8/6/2015 0 20 8/7/2015 0 21 8/8/2015 0 22 8/9/2015 0 23 8/10/2015 0 24 8/11/2015 0 25 8/12/2015 0 26 8/13/2015 0 27 8/14/2015 1 28 8/15/2015 0 29 8/16/2015 0 30 8/17/2015 0 31 8/18/2015 1 32 8/19/2015 0 33 8/20/2015 0 34 8/21/2015 0 35 8/22/2015 2
  • 5. 36 8/23/2015 1 37 8/24/2015 0 38 8/25/2015 0 39 8/26/2015 0 40 8/27/2015 0 41 8/28/2015 0 42 8/29/2015 0 43 8/30/2015 0 44 8/31/2015 0 45 9/1/2015 1 46 9/2/2015 0 47 9/3/2015 0 48 9/4/2015 0 49 9/5/2015 0 50 9/6/2015 0 51 9/7/2015 2 52 9/8/2015 0 53 9/9/2015 0 54 9/10/2015 0 55 9/11/2015 0 56 9/12/2015 0 57 9/13/2015 0 58 9/14/2015 0 59 9/15/2015 0 60 9/16/2015 1 61 9/17/2015 0 62 9/18/2015 0 63 9/19/2015 1 64 9/20/2015 0
  • 6. 65 9/21/2015 0 66 9/22/2015 0 67 9/23/2015 0 68 9/24/2015 0 69 9/25/2015 0 70 9/26/2015 1 71 9/27/2015 0 72 9/28/2015 0 73 9/29/2015 0 74 9/30/2015 0 75 10/1/2015 1 76 10/2/2015 3 77 10/3/2015 0 78 10/4/2015 0 79 10/5/2015 1 80 10/6/2015 1 81 10/7/2015 1 82 10/8/2015 0 83 10/9/2015 0 84 10/10/2015 2 85 10/11/2015 0 86 10/12/2015 0 87 10/13/2015 0 88 10/14/2015 0 89 10/15/2015 0 90 10/16/2015 0 > summary(myfile) Day Number.of.Crimes 10/1/2015 : 1 Min. :0.0
  • 7. 10/10/2015: 1 1st Qu.:0.0 10/11/2015: 1 Median :0.0 10/12/2015: 1 Mean :0.3 10/13/2015: 1 3rd Qu.:0.0 10/14/2015: 1 Max. :3.0 (Other) :84 > names(myfile) [1] "Day" "Number.of.Crimes" > attach(myfile) > names(myfile) [1] "Day" "Number.of.Crimes" > hist(Number.of.Crimes, main="Number of Crimes(Burglary, Strongarm Robbery, SimpleAssault/Battery, Theft of Automobile)") > boxplot(Number.of.Crimes) > stem(Number.of.Crimes) The decimal point is at the | 0 | 00000000000000000000000000000000000000000000000000000000000000000000 0 | 1 | 000000000000000000 1 | 2 | 000 2 | 3 | 0 > var(Number.of.Crimes) [1] 0.347191 > sd(Number.of.Crimes)
  • 8. [1] 0.5892292 > length(Number.of.Crimes) [1] 90 > t1.t.test(Number.of.Crimes, conf.level=0.90) Error: could not find function "t1.t.test" > t1=t.test(Number.of.Crimes, conf.level=0.90) > t2=t.test(Number.of.Crimes, conf.level=0.95) > t3=t.test(Number.of.Crimes, conf.level=0.99) > t4=t.test(Number.of.Crimes, conf.level=1) > t1 One Sample t-test data: Number.of.Crimes t = 4.8301, df = 89, p-value = 5.642e-06 alternative hypothesis: true mean is not equal to 0 90 percent confidence interval: 0.1967632 0.4032368 sample estimates: mean of x 0.3 > t2 One Sample t-test data: Number.of.Crimes t = 4.8301, df = 89, p-value = 5.642e-06 alternative hypothesis: true mean is not equal to 0
  • 9. 95 percent confidence interval: 0.1765883 0.4234117 sample estimates: mean of x 0.3 > t3 One Sample t-test data: Number.of.Crimes t = 4.8301, df = 89, p-value = 5.642e-06 alternative hypothesis: true mean is not equal to 0 99 percent confidence interval: 0.1365133 0.4634867 sample estimates: mean of x 0.3 > t4 One Sample t-test data: Number.of.Crimes t = 4.8301, df = 89, p-value = 5.642e-06 alternative hypothesis: true mean is not equal to 0 100 percent confidence interval: -Inf Inf sample estimates:
  • 10. mean of x 0.3 > ppois(0, lambda=0.3, lower=FALSE) [1] 0.2591818 > dpois(2:7, lambda=0.3, lower=FALSE) Error in dpois(2:7, lambda = 0.3, lower = FALSE) : unused argument (lower = FALSE) > dpois(2:7, lambda=0.3) [1] 3.333682e-02 3.333682e-03 2.500261e-04 1.500157e-05 7.500784e-07 [6] 3.214622e-08 > dpois(1, lambda=1/24) [1] 0.03996623 > hist(Number.of.Crimes) > dpois(1:3, lambda=0.3,) [1] 0.222245466 0.033336820 0.003333682 > dpois(1:3, lambda=0.3) [1] 0.222245466 0.033336820 0.003333682 > getwd() [1] "C:/Users/Kaba/Documents" > boxplot(Number.of.Crimes)