SlideShare ist ein Scribd-Unternehmen logo
1 von 57
Quantitative
Methods
for
Lawyers
Statistical Tests Using R
R Boot Camp - Part 2
Class #15
@ computational
computationallegalstudies.com
professor daniel martin katz danielmartinkatz.com
lexpredict.com slideshare.net/DanielKatz
My Challenge to You
Use R to
Download and
Clean this Simple
DataSet
https://s3.amazonaws.com/KatzCloud/Bloom.csv
Load into R and Do
Some Basic Calculations
Load into R and Do
Some Basic Calculations
# Just Remember that R does not Handle https://
Load into R and Do
Some Basic Calculations
# Just Remember that R does not Handle https://
# Okay We Are Now Loaded
# Here is the Data -
It Looks Okay
# Here is the Data -
It Looks Okay
# Here is the Problem -
Our Data are Factors not Numeric
# Here is the Data -
It Looks Okay
# Here is the Problem -
Our Data are Factors not Numeric
# Thus we get this when trying to
calculate a mean
# Here is the Data -
It Looks Okay
# Here is the Problem -
Our Data are Factors not Numeric
# Thus we get this when trying to
calculate a mean
We have two
problems -
(1) the fact that
our data is non
numeric
(2) and the
commas
# Here is the Data -
It Looks Okay
# Here is the Problem -
Our Data are Factors not Numeric
# Thus we get this when trying to
calculate a mean
# Okay This Is What We Need
We have two
problems -
(1) the fact that
our data is non
numeric
(2) and the
commas
Okay Lets Do Some
Basic Calculations
Okay Lets Do Some
Basic Calculations
# Okay We Are All Set
Okay Lets See How
to Use R
to Run Some of the
Calculations that we
have already seen in
this class
The Binomial
Distribution
Binomial Distribution
“A binomial experiment (also known as a Bernoulli trial) is a
statistical experiment that has the following properties:
The experiment consists of n repeated trials.
Each trial can result in just two possible outcomes.
The probability of success, denoted by P, is the
same on every trial.
The trials are independent”
Example: Coin Flip
Nostradamus
Predicting Coin Flips -
Does you Friend Have the General Ability to
Actually Predict Coin Flips?
How Would You Evaluate This Proposition?
How Many Predictions Would Your Friend Have to Get Right
For You To Believe They Actually Have Real Ability?
Example: Coin Flip
Nostradamus
Ho: Cannot Actually Predict Coin Flips
H1: Can Actually Predict Coin Flip
(i.e. do so at a rate greater than chance)
Ho is the Null Hypothesis
H1 is the Alternative Hypothesis
Reject the Null versus
Failing to Reject the Null
If We Fail to Reject the Null, we are left with the assumption
of no relationship
In the Coin Flip Example, We might have enough evidence
to reject the null
Remember the default (null) is that there is no
relationship
Although a Relationship might actually exist
Example: Coin Flip
Nostradamus
If He Were Guessing - what is the Probability Coin Flip
Nostradamus Predicts at least 3 of 4 Coin Tosses ?
p
probability of success
x
number of successes
n
number of trials
3 or 4 4 1/2
Example: Coin Flip
Nostradamus
If He Were Guessing - what is the Probability Coin Flip
Nostradamus Predicts at least 3 of 4 Coin Tosses ?
p
probability of success
x
number of successes
n
number of trials
3 or 4 4 1/2
Example: Coin Flip
Nostradamus
If He Were Guessing - what is the Probability Coin Flip
Nostradamus Predicts at least 3 of 4 Coin Tosses ?
#Here We Get Only For X=3
Example: Coin Flip
Nostradamus
If He Were Guessing - what is the Probability Coin Flip
Nostradamus Predicts at least 3 of 4 Coin Tosses ?
#Here We Get Only For X=3
#Now We Get a Vector if X=3, X=4
Example: Coin Flip
Nostradamus
If He Were Guessing - what is the Probability Coin Flip
Nostradamus Predicts at least 3 of 4 Coin Tosses ?
#Here We Get Only For X=3
#Now We Get The
Sum of X=3, X=4
#Now We Get a Vector if X=3, X=4
Does 30 heads in 50 flips imply an unfair coin?
Does 30 heads in 50 flips imply an unfair coin?
Does 30 heads in 50 flips imply an unfair coin?
Assuming a Fair Coin - what is the 95% Conf. Interval for 50 flips?
Does 30 heads in 50 flips imply an unfair coin?
Assuming a Fair Coin - what is the 95% Conf. Interval for 50 flips?
Imagine that I gave out a 15
question multiple choice test
with 5 possible answers per
question.
Imagine that I gave out a 15
question multiple choice test
with 5 possible answers per
question.
Using random guessing, what is the probability of
getting exactly 7 questions correct?
Imagine that I gave out a 15
question multiple choice test
with 5 possible answers per
question.
p
probability of success
x
number of successes
n
number of trials
7 15 1/5
Using random guessing, what is the probability of
getting exactly 7 questions correct?
Imagine that I gave out a 15
question multiple choice test
with 5 possible answers per
question.
p
probability of success
x
number of successes
n
number of trials
7 15 1/5
Using random guessing, what is the probability of
getting exactly 7 questions correct?
Imagine that I gave out a 15
question multiple choice test
with 5 possible answers per
question.
p
probability of success
x
number of successes
n
number of trials
7 15 1/5
Using random guessing, what is the probability of
getting exactly 7 questions correct?
This is the exact probability for 7
But What About 7 or Greater?
Imagine that I gave out a 15
question multiple choice test
with 5 possible answers per
question.
Using random guessing, what is the probability of
getting greater than 7 questions correct?
This is our prior answer
Here we are summing 7:15
Normal Distribution
Imagine that a population of students
take a test with an average score of 78
and a standard deviation of 9.
Assuming the test scores are normally
distributed, how many students
received a 90 or higher?
Imagine that a population 100
Students take a test with an
average score of 78
and a standard deviation of 9.
Assuming the test scores are
normally distributed, how many
students received a 90 or higher?
Imagine that a population 100
Students take a test with an
average score of 78
and a standard deviation of 9.
Assuming the test scores are
normally distributed, how many
students received a 90 or higher?
pnorm(q , mean= ,  sd= , lower.tail=TRUE) This is the Syntax:
Imagine that a population 100
Students take a test with an
average score of 78
and a standard deviation of 9.
Assuming the test scores are
normally distributed, how many
students received a 90 or higher?
pnorm(q , mean= ,  sd= , lower.tail=TRUE) This is the Syntax:
pnorm(90 , mean= 78 ,  sd=9 , lower.tail=FALSE) What We Want:
because we want upper tail
Imagine that a population 100
Students take a test with an
average score of 78
and a standard deviation of 9.
Assuming the test scores are
normally distributed, how many
students received a 90 or higher?
pnorm(q , mean= ,  sd= , lower.tail=TRUE) This is the Syntax:
pnorm(90 , mean= 78 ,  sd=9 , lower.tail=FALSE) What We Want:
because we want upper tail
In the 2011-2012 year the national
average on the LSAT was 150.66
with a Standard Deviation of
10.19
Assuming those scores are
normally distributed, what
percentage of test takers scored
160 or above? http://www.lsac.org/docs/default-source/
research-%28lsac-resources%29/tr-12-03.pdf
Table 1 on Page 9
In the 2011-2012 year the national
average on the LSAT was 150.66
with a Standard Deviation of
10.19
Assuming those scores are
normally distributed, what
percentage of test takers scored
160 or above? http://www.lsac.org/docs/default-source/
research-%28lsac-resources%29/tr-12-03.pdf
Table 1 on Page 9
Hypothesis Testing
235,000
175,000
750,000
230,000
450,000
150,000
1,000,060
910,000
150,000
220,000
130,000
170,000
234,000
450,000
890,000
101,000
120,000
560,000
321,000
456,000
102,000
30,000
793,000
250,900
862,000
673,000
463,000
54,000
39,000
687,000
260,800
682,000
3,514,000
67,000
356,000
13,000
42,000
4,000
402,000
943,000
961,600
630,000
398,800
52,000
976,500
540,000
Awards in Rest of State Awards in Bloom County
N = 21
N = 25
Are Damage Awards in
Bloom County Excessive?
H0: There is No Difference Between the Mean Damage Award
in Bloom County and the Mean Damage Award in the Rest of
the State
This is
a
Two
Sample
Problem
H0: There is No Difference Between the Mean Damage
Award in Bloom County and the Mean Damage Award in
the Rest of the State
Num of Obs. Mean Std. Dev.
GROUP 1
Rest of State
21 $371,621 $289,823
GROUP 2
Bloom County
25 $547,784 $703,314
Given the sample size we might consider a T-Test
But We Need To Check For Normality
Okay this means we need to use a non-parametric test
Good News is that is Available in
This is tricky because we have do
not have even sized samples
Also the Sample is Pretty Small
As reported on Page
274 of Lawless, et. al.
Chi Squared Test
Male Female Totals
Not Research Asst 319 323 642
Research Assistant 60 34 94
Total 379 357 736
RA’s Hired at a School are mostly Men
60 out of 94 RA’s are Men (See Above)
Could this just be chance or is it too large to be
explained by chance?
Chi Square ( ) Statisticχ 2
Male Female Totals
Not
Research
Asst
319 323 642
Research
Assistant
60 34 94
Total 379 357 736
F Statistic
F Test
2500
1500
1500
1300
2000
1500
1500
2000
2000
1500
1400
1500
2000
800
3000
1500
2000
2000
1700
2500
2299
1900
2050
2101
1160
2101
1300
3500
900
995
1299
1900
995
771
1250
900
749
1200
950
1200
995
1300
1600
1601
1000
1371
2400
1500
1325
1500
1799
2780
1800
1399
2225
1700
3800
2299
1800
1450
1500
1000
1500
1799
1600
1600
2000
2500
1200
2500
2000
1500
Northern
District
Western
District
Southern
District
Eastern
District
Attorneys Fees in
Chapter 7 BK’s in Texas
Districts
(From Lawless, et al)
https://s3.amazonaws.com/KatzCloud/AttyFeesTexasBKDist.csv
Daniel Martin Katz
@ computational
computationallegalstudies.com
lexpredict.com
danielmartinkatz.com
illinois tech - chicago kent college of law@

Weitere ähnliche Inhalte

Was ist angesagt?

Chapter2 slides-part 2-harish complete
Chapter2 slides-part 2-harish completeChapter2 slides-part 2-harish complete
Chapter2 slides-part 2-harish complete
EasyStudy3
 
Chapter 07
Chapter 07Chapter 07
Chapter 07
bmcfad01
 
Confidence intervals
Confidence intervalsConfidence intervals
Confidence intervals
Tanay Tandon
 

Was ist angesagt? (20)

Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Testing a Claim About a Mean
Testing a Claim About a MeanTesting a Claim About a Mean
Testing a Claim About a Mean
 
Chapter2 slides-part 2-harish complete
Chapter2 slides-part 2-harish completeChapter2 slides-part 2-harish complete
Chapter2 slides-part 2-harish complete
 
Chapter 07
Chapter 07Chapter 07
Chapter 07
 
Types of Probability Distributions - Statistics II
Types of Probability Distributions - Statistics IITypes of Probability Distributions - Statistics II
Types of Probability Distributions - Statistics II
 
Probability distribution in R
Probability distribution in RProbability distribution in R
Probability distribution in R
 
A Lecture on Sample Size and Statistical Inference for Health Researchers
A Lecture on Sample Size and Statistical Inference for Health ResearchersA Lecture on Sample Size and Statistical Inference for Health Researchers
A Lecture on Sample Size and Statistical Inference for Health Researchers
 
Pengenalan Ekonometrika
Pengenalan EkonometrikaPengenalan Ekonometrika
Pengenalan Ekonometrika
 
Binomial Probability Distributions
Binomial Probability DistributionsBinomial Probability Distributions
Binomial Probability Distributions
 
Math533 finalexamreviewapr13
Math533 finalexamreviewapr13Math533 finalexamreviewapr13
Math533 finalexamreviewapr13
 
Confidence intervals
Confidence intervalsConfidence intervals
Confidence intervals
 
Continuous probability Business Statistics, Management
Continuous probability Business Statistics, ManagementContinuous probability Business Statistics, Management
Continuous probability Business Statistics, Management
 
Statistical Analysis with R- III
Statistical Analysis with R- IIIStatistical Analysis with R- III
Statistical Analysis with R- III
 
Lecture 5: Interval Estimation
Lecture 5: Interval Estimation Lecture 5: Interval Estimation
Lecture 5: Interval Estimation
 
Chapter9
Chapter9Chapter9
Chapter9
 
Math 533 week 6 more help
Math 533 week 6   more helpMath 533 week 6   more help
Math 533 week 6 more help
 
Week7 Quiz Help 2009[1]
Week7 Quiz Help 2009[1]Week7 Quiz Help 2009[1]
Week7 Quiz Help 2009[1]
 
Week 7 lecture_math_221_apr_2012
Week 7 lecture_math_221_apr_2012Week 7 lecture_math_221_apr_2012
Week 7 lecture_math_221_apr_2012
 
3by9on w week_6
3by9on w week_63by9on w week_6
3by9on w week_6
 
Hypothesis Testing
Hypothesis TestingHypothesis Testing
Hypothesis Testing
 

Andere mochten auch

a-startup-guide-to-marketing-automation-for-sugarcrm
a-startup-guide-to-marketing-automation-for-sugarcrma-startup-guide-to-marketing-automation-for-sugarcrm
a-startup-guide-to-marketing-automation-for-sugarcrm
Bill Kahlert
 
Colombia_II_ppt
Colombia_II_pptColombia_II_ppt
Colombia_II_ppt
stimson
 
Growth Hacking Mobile Apps: 3 Critical Growth Tactics
Growth Hacking Mobile Apps: 3 Critical Growth TacticsGrowth Hacking Mobile Apps: 3 Critical Growth Tactics
Growth Hacking Mobile Apps: 3 Critical Growth Tactics
 Urban Airship
 

Andere mochten auch (20)

安全防護
安全防護安全防護
安全防護
 
a-startup-guide-to-marketing-automation-for-sugarcrm
a-startup-guide-to-marketing-automation-for-sugarcrma-startup-guide-to-marketing-automation-for-sugarcrm
a-startup-guide-to-marketing-automation-for-sugarcrm
 
Colombia_II_ppt
Colombia_II_pptColombia_II_ppt
Colombia_II_ppt
 
Facebook for-business
Facebook for-businessFacebook for-business
Facebook for-business
 
Topic 4 nutrition part 2 : COMPILED from Various resources
Topic 4  nutrition part 2 : COMPILED from Various resourcesTopic 4  nutrition part 2 : COMPILED from Various resources
Topic 4 nutrition part 2 : COMPILED from Various resources
 
PDM & DRM
PDM & DRMPDM & DRM
PDM & DRM
 
20151110 easymoove ita_short
20151110 easymoove ita_short20151110 easymoove ita_short
20151110 easymoove ita_short
 
Cloud storage security
Cloud storage securityCloud storage security
Cloud storage security
 
The Science Behind Resistance to Change: What the Research Says & How it 
Can...
The Science Behind Resistance to Change: What the Research Says & How it 
Can...The Science Behind Resistance to Change: What the Research Says & How it 
Can...
The Science Behind Resistance to Change: What the Research Says & How it 
Can...
 
Growth Hacking Mobile Apps: 3 Critical Growth Tactics
Growth Hacking Mobile Apps: 3 Critical Growth TacticsGrowth Hacking Mobile Apps: 3 Critical Growth Tactics
Growth Hacking Mobile Apps: 3 Critical Growth Tactics
 
Planilha treino-5km
Planilha treino-5kmPlanilha treino-5km
Planilha treino-5km
 
The Future of User Engagement Through Apps and IoT
The Future of User Engagement Through Apps and IoTThe Future of User Engagement Through Apps and IoT
The Future of User Engagement Through Apps and IoT
 
Applying Lean Thinking to Legal-Service Delivery - Lean Process Improvement a...
Applying Lean Thinking to Legal-Service Delivery - Lean Process Improvement a...Applying Lean Thinking to Legal-Service Delivery - Lean Process Improvement a...
Applying Lean Thinking to Legal-Service Delivery - Lean Process Improvement a...
 
The Mobile Engagement Playbook - Going from Good to Great
The Mobile Engagement Playbook - Going from Good to GreatThe Mobile Engagement Playbook - Going from Good to Great
The Mobile Engagement Playbook - Going from Good to Great
 
PMO Insights - PMO e a Gestão de Benefícios
PMO Insights - PMO e a Gestão de BenefíciosPMO Insights - PMO e a Gestão de Benefícios
PMO Insights - PMO e a Gestão de Benefícios
 
#Fame case study
#Fame case study#Fame case study
#Fame case study
 
Managing Lean Hospitals
Managing Lean HospitalsManaging Lean Hospitals
Managing Lean Hospitals
 
Maxim Babichev, VK.com
Maxim Babichev, VK.comMaxim Babichev, VK.com
Maxim Babichev, VK.com
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
Guising in Halloween
Guising in HalloweenGuising in Halloween
Guising in Halloween
 

Ähnlich wie Quantitative Methods for Lawyers - Class #15 - R Boot Camp - Part 2 - Professor Daniel Martin Katz

F ProjHOSPITAL INPATIENT P & L20162017Variance Variance Per DC 20.docx
F ProjHOSPITAL INPATIENT P & L20162017Variance Variance Per DC 20.docxF ProjHOSPITAL INPATIENT P & L20162017Variance Variance Per DC 20.docx
F ProjHOSPITAL INPATIENT P & L20162017Variance Variance Per DC 20.docx
mecklenburgstrelitzh
 
35880 Topic Discussion7Number of Pages 1 (Double Spaced).docx
35880 Topic Discussion7Number of Pages 1 (Double Spaced).docx35880 Topic Discussion7Number of Pages 1 (Double Spaced).docx
35880 Topic Discussion7Number of Pages 1 (Double Spaced).docx
domenicacullison
 
35878 Topic Discussion5Number of Pages 1 (Double Spaced).docx
35878 Topic Discussion5Number of Pages 1 (Double Spaced).docx35878 Topic Discussion5Number of Pages 1 (Double Spaced).docx
35878 Topic Discussion5Number of Pages 1 (Double Spaced).docx
rhetttrevannion
 
35881 DiscussionNumber of Pages 1 (Double Spaced)Number o.docx
35881 DiscussionNumber of Pages 1 (Double Spaced)Number o.docx35881 DiscussionNumber of Pages 1 (Double Spaced)Number o.docx
35881 DiscussionNumber of Pages 1 (Double Spaced)Number o.docx
rhetttrevannion
 
The t Test for Related.docx
The t Test for Related.docxThe t Test for Related.docx
The t Test for Related.docx
christalgrieg
 

Ähnlich wie Quantitative Methods for Lawyers - Class #15 - R Boot Camp - Part 2 - Professor Daniel Martin Katz (20)

data handling class 8
data handling class 8data handling class 8
data handling class 8
 
Math class 8 data handling
Math class 8 data handling Math class 8 data handling
Math class 8 data handling
 
F ProjHOSPITAL INPATIENT P & L20162017Variance Variance Per DC 20.docx
F ProjHOSPITAL INPATIENT P & L20162017Variance Variance Per DC 20.docxF ProjHOSPITAL INPATIENT P & L20162017Variance Variance Per DC 20.docx
F ProjHOSPITAL INPATIENT P & L20162017Variance Variance Per DC 20.docx
 
Statistical tests
Statistical testsStatistical tests
Statistical tests
 
Risk Management - CH 7 - Hypothesis Tests and Confidence | CMT Level 3 | Char...
Risk Management - CH 7 - Hypothesis Tests and Confidence | CMT Level 3 | Char...Risk Management - CH 7 - Hypothesis Tests and Confidence | CMT Level 3 | Char...
Risk Management - CH 7 - Hypothesis Tests and Confidence | CMT Level 3 | Char...
 
Confidence interval put values in green cells; output or answers in
Confidence interval put values in green cells; output or answers inConfidence interval put values in green cells; output or answers in
Confidence interval put values in green cells; output or answers in
 
Module-2_Notes-with-Example for data science
Module-2_Notes-with-Example for data scienceModule-2_Notes-with-Example for data science
Module-2_Notes-with-Example for data science
 
35880 Topic Discussion7Number of Pages 1 (Double Spaced).docx
35880 Topic Discussion7Number of Pages 1 (Double Spaced).docx35880 Topic Discussion7Number of Pages 1 (Double Spaced).docx
35880 Topic Discussion7Number of Pages 1 (Double Spaced).docx
 
35878 Topic Discussion5Number of Pages 1 (Double Spaced).docx
35878 Topic Discussion5Number of Pages 1 (Double Spaced).docx35878 Topic Discussion5Number of Pages 1 (Double Spaced).docx
35878 Topic Discussion5Number of Pages 1 (Double Spaced).docx
 
Big Data Analytics: The Math, the Implementation and How it can be Effectivel...
Big Data Analytics: The Math, the Implementation and How it can be Effectivel...Big Data Analytics: The Math, the Implementation and How it can be Effectivel...
Big Data Analytics: The Math, the Implementation and How it can be Effectivel...
 
Quantitative Methods for Lawyers - Class #14 - Power Laws, Hypothesis Testing...
Quantitative Methods for Lawyers - Class #14 - Power Laws, Hypothesis Testing...Quantitative Methods for Lawyers - Class #14 - Power Laws, Hypothesis Testing...
Quantitative Methods for Lawyers - Class #14 - Power Laws, Hypothesis Testing...
 
Statistics
StatisticsStatistics
Statistics
 
35881 DiscussionNumber of Pages 1 (Double Spaced)Number o.docx
35881 DiscussionNumber of Pages 1 (Double Spaced)Number o.docx35881 DiscussionNumber of Pages 1 (Double Spaced)Number o.docx
35881 DiscussionNumber of Pages 1 (Double Spaced)Number o.docx
 
Infernetial vs desctiptive (jejit + indepth)
Infernetial vs desctiptive (jejit + indepth)Infernetial vs desctiptive (jejit + indepth)
Infernetial vs desctiptive (jejit + indepth)
 
The t Test for Related.docx
The t Test for Related.docxThe t Test for Related.docx
The t Test for Related.docx
 
Chapter 5 part2- Sampling Distributions for Counts and Proportions (Binomial ...
Chapter 5 part2- Sampling Distributions for Counts and Proportions (Binomial ...Chapter 5 part2- Sampling Distributions for Counts and Proportions (Binomial ...
Chapter 5 part2- Sampling Distributions for Counts and Proportions (Binomial ...
 
Statistics
StatisticsStatistics
Statistics
 
CABT Math 8 - Fundamental Principle of Counting
CABT Math 8 - Fundamental Principle of CountingCABT Math 8 - Fundamental Principle of Counting
CABT Math 8 - Fundamental Principle of Counting
 
Week8finalexamlivelecture april2012
Week8finalexamlivelecture april2012Week8finalexamlivelecture april2012
Week8finalexamlivelecture april2012
 
Week8finalexamlivelecture dec2012
Week8finalexamlivelecture dec2012Week8finalexamlivelecture dec2012
Week8finalexamlivelecture dec2012
 

Mehr von Daniel Katz

Mehr von Daniel Katz (20)

Legal Analytics versus Empirical Legal Studies - or - Causal Inference vs Pre...
Legal Analytics versus Empirical Legal Studies - or - Causal Inference vs Pre...Legal Analytics versus Empirical Legal Studies - or - Causal Inference vs Pre...
Legal Analytics versus Empirical Legal Studies - or - Causal Inference vs Pre...
 
Can Law Librarians Help Law Become More Data Driven ? An Open Question in Ne...
Can Law Librarians Help Law Become More Data Driven ?  An Open Question in Ne...Can Law Librarians Help Law Become More Data Driven ?  An Open Question in Ne...
Can Law Librarians Help Law Become More Data Driven ? An Open Question in Ne...
 
Why We Are Open Sourcing ContraxSuite and Some Thoughts About Legal Tech and ...
Why We Are Open Sourcing ContraxSuite and Some Thoughts About Legal Tech and ...Why We Are Open Sourcing ContraxSuite and Some Thoughts About Legal Tech and ...
Why We Are Open Sourcing ContraxSuite and Some Thoughts About Legal Tech and ...
 
Fin (Legal) Tech – Law’s Future from Finance’s Past (Some Thoughts About the ...
Fin (Legal) Tech – Law’s Future from Finance’s Past (Some Thoughts About the ...Fin (Legal) Tech – Law’s Future from Finance’s Past (Some Thoughts About the ...
Fin (Legal) Tech – Law’s Future from Finance’s Past (Some Thoughts About the ...
 
Exploring the Physical Properties of Regulatory Ecosystems - Professors Danie...
Exploring the Physical Properties of Regulatory Ecosystems - Professors Danie...Exploring the Physical Properties of Regulatory Ecosystems - Professors Danie...
Exploring the Physical Properties of Regulatory Ecosystems - Professors Danie...
 
Law + Complexity & Prediction: Toward a Characterization of Legal Systems as ...
Law + Complexity & Prediction: Toward a Characterization of Legal Systems as ...Law + Complexity & Prediction: Toward a Characterization of Legal Systems as ...
Law + Complexity & Prediction: Toward a Characterization of Legal Systems as ...
 
Building Your Personal (Legal) Brand - Some Thoughts for Law Students and Oth...
Building Your Personal (Legal) Brand - Some Thoughts for Law Students and Oth...Building Your Personal (Legal) Brand - Some Thoughts for Law Students and Oth...
Building Your Personal (Legal) Brand - Some Thoughts for Law Students and Oth...
 
Measure Twice, Cut Once - Solving the Legal Profession Biggest Challenges Tog...
Measure Twice, Cut Once - Solving the Legal Profession Biggest Challenges Tog...Measure Twice, Cut Once - Solving the Legal Profession Biggest Challenges Tog...
Measure Twice, Cut Once - Solving the Legal Profession Biggest Challenges Tog...
 
Artificial Intelligence and Law - 
A Primer
Artificial Intelligence and Law - 
A Primer Artificial Intelligence and Law - 
A Primer
Artificial Intelligence and Law - 
A Primer
 
Machine Learning as a Service: #MLaaS, Open Source and the Future of (Legal) ...
Machine Learning as a Service: #MLaaS, Open Source and the Future of (Legal) ...Machine Learning as a Service: #MLaaS, Open Source and the Future of (Legal) ...
Machine Learning as a Service: #MLaaS, Open Source and the Future of (Legal) ...
 
Technology, Data and Computation Session @ The World Bank - Law, Justice, and...
Technology, Data and Computation Session @ The World Bank - Law, Justice, and...Technology, Data and Computation Session @ The World Bank - Law, Justice, and...
Technology, Data and Computation Session @ The World Bank - Law, Justice, and...
 
LexPredict - Empowering the Future of Legal Decision Making
LexPredict - Empowering the Future of Legal Decision MakingLexPredict - Empowering the Future of Legal Decision Making
LexPredict - Empowering the Future of Legal Decision Making
 
{Law, Tech, Design, Delivery} Observations Regarding Innovation in the Legal ...
{Law, Tech, Design, Delivery} Observations Regarding Innovation in the Legal ...{Law, Tech, Design, Delivery} Observations Regarding Innovation in the Legal ...
{Law, Tech, Design, Delivery} Observations Regarding Innovation in the Legal ...
 
Legal Analytics Course - Class 11 - Network Analysis and Law - Professors Dan...
Legal Analytics Course - Class 11 - Network Analysis and Law - Professors Dan...Legal Analytics Course - Class 11 - Network Analysis and Law - Professors Dan...
Legal Analytics Course - Class 11 - Network Analysis and Law - Professors Dan...
 
Legal Analytics Course - Class 12 - Data Preprocessing using dPlyR - Professo...
Legal Analytics Course - Class 12 - Data Preprocessing using dPlyR - Professo...Legal Analytics Course - Class 12 - Data Preprocessing using dPlyR - Professo...
Legal Analytics Course - Class 12 - Data Preprocessing using dPlyR - Professo...
 
Legal Analytics Course - Class 10 - Information Visualization + DataViz in R ...
Legal Analytics Course - Class 10 - Information Visualization + DataViz in R ...Legal Analytics Course - Class 10 - Information Visualization + DataViz in R ...
Legal Analytics Course - Class 10 - Information Visualization + DataViz in R ...
 
Legal Analytics Course - Class #4 - Github and RMarkdown Tutorial - Professor...
Legal Analytics Course - Class #4 - Github and RMarkdown Tutorial - Professor...Legal Analytics Course - Class #4 - Github and RMarkdown Tutorial - Professor...
Legal Analytics Course - Class #4 - Github and RMarkdown Tutorial - Professor...
 
Legal Analytics Course - Class 9 - Clustering Algorithms (K-Means & Hierarch...
Legal Analytics Course - Class 9 -  Clustering Algorithms (K-Means & Hierarch...Legal Analytics Course - Class 9 -  Clustering Algorithms (K-Means & Hierarch...
Legal Analytics Course - Class 9 - Clustering Algorithms (K-Means & Hierarch...
 
Legal Analytics Course - Class 8 - Introduction to Random Forests and Ensembl...
Legal Analytics Course - Class 8 - Introduction to Random Forests and Ensembl...Legal Analytics Course - Class 8 - Introduction to Random Forests and Ensembl...
Legal Analytics Course - Class 8 - Introduction to Random Forests and Ensembl...
 
Legal Analytics Course - Class 7 - Binary Classification with Decision Tree L...
Legal Analytics Course - Class 7 - Binary Classification with Decision Tree L...Legal Analytics Course - Class 7 - Binary Classification with Decision Tree L...
Legal Analytics Course - Class 7 - Binary Classification with Decision Tree L...
 

Kürzlich hochgeladen

Appeal and Revision in Income Tax Act.pdf
Appeal and Revision in Income Tax Act.pdfAppeal and Revision in Income Tax Act.pdf
Appeal and Revision in Income Tax Act.pdf
PoojaGadiya1
 
一比一原版旧金山州立大学毕业证学位证书
 一比一原版旧金山州立大学毕业证学位证书 一比一原版旧金山州立大学毕业证学位证书
一比一原版旧金山州立大学毕业证学位证书
SS A
 
Russian Call Girls Rohini Sector 6 💓 Delhi 9999965857 @Sabina Modi VVIP MODEL...
Russian Call Girls Rohini Sector 6 💓 Delhi 9999965857 @Sabina Modi VVIP MODEL...Russian Call Girls Rohini Sector 6 💓 Delhi 9999965857 @Sabina Modi VVIP MODEL...
Russian Call Girls Rohini Sector 6 💓 Delhi 9999965857 @Sabina Modi VVIP MODEL...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
6th sem cpc notes for 6th semester students samjhe. Padhlo bhai
6th sem cpc notes for 6th semester students samjhe. Padhlo bhai6th sem cpc notes for 6th semester students samjhe. Padhlo bhai
6th sem cpc notes for 6th semester students samjhe. Padhlo bhai
ShashankKumar441258
 
Sensual Moments: +91 9999965857 Independent Call Girls Vasundhara Delhi {{ Mo...
Sensual Moments: +91 9999965857 Independent Call Girls Vasundhara Delhi {{ Mo...Sensual Moments: +91 9999965857 Independent Call Girls Vasundhara Delhi {{ Mo...
Sensual Moments: +91 9999965857 Independent Call Girls Vasundhara Delhi {{ Mo...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
一比一原版西澳大学毕业证学位证书
 一比一原版西澳大学毕业证学位证书 一比一原版西澳大学毕业证学位证书
一比一原版西澳大学毕业证学位证书
SS A
 
PowerPoint - Legal Citation Form 1 - Case Law.pptx
PowerPoint - Legal Citation Form 1 - Case Law.pptxPowerPoint - Legal Citation Form 1 - Case Law.pptx
PowerPoint - Legal Citation Form 1 - Case Law.pptx
ca2or2tx
 
Audience profile - SF.pptxxxxxxxxxxxxxxxxxxxxxxxxxxx
Audience profile - SF.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxAudience profile - SF.pptxxxxxxxxxxxxxxxxxxxxxxxxxxx
Audience profile - SF.pptxxxxxxxxxxxxxxxxxxxxxxxxxxx
MollyBrown86
 
一比一原版利兹大学毕业证学位证书
一比一原版利兹大学毕业证学位证书一比一原版利兹大学毕业证学位证书
一比一原版利兹大学毕业证学位证书
E LSS
 
INVOLUNTARY TRANSFERS Kenya school of law.pptx
INVOLUNTARY TRANSFERS Kenya school of law.pptxINVOLUNTARY TRANSFERS Kenya school of law.pptx
INVOLUNTARY TRANSFERS Kenya school of law.pptx
nyabatejosphat1
 

Kürzlich hochgeladen (20)

Appeal and Revision in Income Tax Act.pdf
Appeal and Revision in Income Tax Act.pdfAppeal and Revision in Income Tax Act.pdf
Appeal and Revision in Income Tax Act.pdf
 
CAFC Chronicles: Costly Tales of Claim Construction Fails
CAFC Chronicles: Costly Tales of Claim Construction FailsCAFC Chronicles: Costly Tales of Claim Construction Fails
CAFC Chronicles: Costly Tales of Claim Construction Fails
 
一比一原版旧金山州立大学毕业证学位证书
 一比一原版旧金山州立大学毕业证学位证书 一比一原版旧金山州立大学毕业证学位证书
一比一原版旧金山州立大学毕业证学位证书
 
Russian Call Girls Rohini Sector 6 💓 Delhi 9999965857 @Sabina Modi VVIP MODEL...
Russian Call Girls Rohini Sector 6 💓 Delhi 9999965857 @Sabina Modi VVIP MODEL...Russian Call Girls Rohini Sector 6 💓 Delhi 9999965857 @Sabina Modi VVIP MODEL...
Russian Call Girls Rohini Sector 6 💓 Delhi 9999965857 @Sabina Modi VVIP MODEL...
 
6th sem cpc notes for 6th semester students samjhe. Padhlo bhai
6th sem cpc notes for 6th semester students samjhe. Padhlo bhai6th sem cpc notes for 6th semester students samjhe. Padhlo bhai
6th sem cpc notes for 6th semester students samjhe. Padhlo bhai
 
Human Rights_FilippoLuciani diritti umani.pptx
Human Rights_FilippoLuciani diritti umani.pptxHuman Rights_FilippoLuciani diritti umani.pptx
Human Rights_FilippoLuciani diritti umani.pptx
 
How do cyber crime lawyers in Mumbai collaborate with law enforcement agencie...
How do cyber crime lawyers in Mumbai collaborate with law enforcement agencie...How do cyber crime lawyers in Mumbai collaborate with law enforcement agencie...
How do cyber crime lawyers in Mumbai collaborate with law enforcement agencie...
 
Chp 1- Contract and its kinds-business law .ppt
Chp 1- Contract and its kinds-business law .pptChp 1- Contract and its kinds-business law .ppt
Chp 1- Contract and its kinds-business law .ppt
 
Sensual Moments: +91 9999965857 Independent Call Girls Vasundhara Delhi {{ Mo...
Sensual Moments: +91 9999965857 Independent Call Girls Vasundhara Delhi {{ Mo...Sensual Moments: +91 9999965857 Independent Call Girls Vasundhara Delhi {{ Mo...
Sensual Moments: +91 9999965857 Independent Call Girls Vasundhara Delhi {{ Mo...
 
IBC (Insolvency and Bankruptcy Code 2016)-IOD - PPT.pptx
IBC (Insolvency and Bankruptcy Code 2016)-IOD - PPT.pptxIBC (Insolvency and Bankruptcy Code 2016)-IOD - PPT.pptx
IBC (Insolvency and Bankruptcy Code 2016)-IOD - PPT.pptx
 
一比一原版西澳大学毕业证学位证书
 一比一原版西澳大学毕业证学位证书 一比一原版西澳大学毕业证学位证书
一比一原版西澳大学毕业证学位证书
 
PowerPoint - Legal Citation Form 1 - Case Law.pptx
PowerPoint - Legal Citation Form 1 - Case Law.pptxPowerPoint - Legal Citation Form 1 - Case Law.pptx
PowerPoint - Legal Citation Form 1 - Case Law.pptx
 
Audience profile - SF.pptxxxxxxxxxxxxxxxxxxxxxxxxxxx
Audience profile - SF.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxAudience profile - SF.pptxxxxxxxxxxxxxxxxxxxxxxxxxxx
Audience profile - SF.pptxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
Essentials of a Valid Transfer.pptxmmmmmm
Essentials of a Valid Transfer.pptxmmmmmmEssentials of a Valid Transfer.pptxmmmmmm
Essentials of a Valid Transfer.pptxmmmmmm
 
THE FACTORIES ACT,1948 (2).pptx labour
THE FACTORIES ACT,1948 (2).pptx   labourTHE FACTORIES ACT,1948 (2).pptx   labour
THE FACTORIES ACT,1948 (2).pptx labour
 
589308994-interpretation-of-statutes-notes-law-college.pdf
589308994-interpretation-of-statutes-notes-law-college.pdf589308994-interpretation-of-statutes-notes-law-college.pdf
589308994-interpretation-of-statutes-notes-law-college.pdf
 
一比一原版利兹大学毕业证学位证书
一比一原版利兹大学毕业证学位证书一比一原版利兹大学毕业证学位证书
一比一原版利兹大学毕业证学位证书
 
INVOLUNTARY TRANSFERS Kenya school of law.pptx
INVOLUNTARY TRANSFERS Kenya school of law.pptxINVOLUNTARY TRANSFERS Kenya school of law.pptx
INVOLUNTARY TRANSFERS Kenya school of law.pptx
 
The doctrine of harmonious construction under Interpretation of statute
The doctrine of harmonious construction under Interpretation of statuteThe doctrine of harmonious construction under Interpretation of statute
The doctrine of harmonious construction under Interpretation of statute
 
Municipal-Council-Ratlam-vs-Vardi-Chand-A-Landmark-Writ-Case.pptx
Municipal-Council-Ratlam-vs-Vardi-Chand-A-Landmark-Writ-Case.pptxMunicipal-Council-Ratlam-vs-Vardi-Chand-A-Landmark-Writ-Case.pptx
Municipal-Council-Ratlam-vs-Vardi-Chand-A-Landmark-Writ-Case.pptx
 

Quantitative Methods for Lawyers - Class #15 - R Boot Camp - Part 2 - Professor Daniel Martin Katz

  • 1. Quantitative Methods for Lawyers Statistical Tests Using R R Boot Camp - Part 2 Class #15 @ computational computationallegalstudies.com professor daniel martin katz danielmartinkatz.com lexpredict.com slideshare.net/DanielKatz
  • 2. My Challenge to You Use R to Download and Clean this Simple DataSet
  • 4. Load into R and Do Some Basic Calculations # Just Remember that R does not Handle https://
  • 5. Load into R and Do Some Basic Calculations # Just Remember that R does not Handle https:// # Okay We Are Now Loaded
  • 6. # Here is the Data - It Looks Okay
  • 7. # Here is the Data - It Looks Okay # Here is the Problem - Our Data are Factors not Numeric
  • 8. # Here is the Data - It Looks Okay # Here is the Problem - Our Data are Factors not Numeric # Thus we get this when trying to calculate a mean
  • 9. # Here is the Data - It Looks Okay # Here is the Problem - Our Data are Factors not Numeric # Thus we get this when trying to calculate a mean We have two problems - (1) the fact that our data is non numeric (2) and the commas
  • 10. # Here is the Data - It Looks Okay # Here is the Problem - Our Data are Factors not Numeric # Thus we get this when trying to calculate a mean # Okay This Is What We Need We have two problems - (1) the fact that our data is non numeric (2) and the commas
  • 11. Okay Lets Do Some Basic Calculations
  • 12. Okay Lets Do Some Basic Calculations # Okay We Are All Set
  • 13. Okay Lets See How to Use R to Run Some of the Calculations that we have already seen in this class
  • 15. Binomial Distribution “A binomial experiment (also known as a Bernoulli trial) is a statistical experiment that has the following properties: The experiment consists of n repeated trials. Each trial can result in just two possible outcomes. The probability of success, denoted by P, is the same on every trial. The trials are independent”
  • 16. Example: Coin Flip Nostradamus Predicting Coin Flips - Does you Friend Have the General Ability to Actually Predict Coin Flips? How Would You Evaluate This Proposition? How Many Predictions Would Your Friend Have to Get Right For You To Believe They Actually Have Real Ability?
  • 17. Example: Coin Flip Nostradamus Ho: Cannot Actually Predict Coin Flips H1: Can Actually Predict Coin Flip (i.e. do so at a rate greater than chance) Ho is the Null Hypothesis H1 is the Alternative Hypothesis
  • 18. Reject the Null versus Failing to Reject the Null If We Fail to Reject the Null, we are left with the assumption of no relationship In the Coin Flip Example, We might have enough evidence to reject the null Remember the default (null) is that there is no relationship Although a Relationship might actually exist
  • 19. Example: Coin Flip Nostradamus If He Were Guessing - what is the Probability Coin Flip Nostradamus Predicts at least 3 of 4 Coin Tosses ? p probability of success x number of successes n number of trials 3 or 4 4 1/2
  • 20.
  • 21. Example: Coin Flip Nostradamus If He Were Guessing - what is the Probability Coin Flip Nostradamus Predicts at least 3 of 4 Coin Tosses ? p probability of success x number of successes n number of trials 3 or 4 4 1/2
  • 22. Example: Coin Flip Nostradamus If He Were Guessing - what is the Probability Coin Flip Nostradamus Predicts at least 3 of 4 Coin Tosses ? #Here We Get Only For X=3
  • 23. Example: Coin Flip Nostradamus If He Were Guessing - what is the Probability Coin Flip Nostradamus Predicts at least 3 of 4 Coin Tosses ? #Here We Get Only For X=3 #Now We Get a Vector if X=3, X=4
  • 24. Example: Coin Flip Nostradamus If He Were Guessing - what is the Probability Coin Flip Nostradamus Predicts at least 3 of 4 Coin Tosses ? #Here We Get Only For X=3 #Now We Get The Sum of X=3, X=4 #Now We Get a Vector if X=3, X=4
  • 25. Does 30 heads in 50 flips imply an unfair coin?
  • 26. Does 30 heads in 50 flips imply an unfair coin?
  • 27. Does 30 heads in 50 flips imply an unfair coin? Assuming a Fair Coin - what is the 95% Conf. Interval for 50 flips?
  • 28. Does 30 heads in 50 flips imply an unfair coin? Assuming a Fair Coin - what is the 95% Conf. Interval for 50 flips?
  • 29. Imagine that I gave out a 15 question multiple choice test with 5 possible answers per question.
  • 30. Imagine that I gave out a 15 question multiple choice test with 5 possible answers per question. Using random guessing, what is the probability of getting exactly 7 questions correct?
  • 31. Imagine that I gave out a 15 question multiple choice test with 5 possible answers per question. p probability of success x number of successes n number of trials 7 15 1/5 Using random guessing, what is the probability of getting exactly 7 questions correct?
  • 32. Imagine that I gave out a 15 question multiple choice test with 5 possible answers per question. p probability of success x number of successes n number of trials 7 15 1/5 Using random guessing, what is the probability of getting exactly 7 questions correct?
  • 33. Imagine that I gave out a 15 question multiple choice test with 5 possible answers per question. p probability of success x number of successes n number of trials 7 15 1/5 Using random guessing, what is the probability of getting exactly 7 questions correct? This is the exact probability for 7 But What About 7 or Greater?
  • 34. Imagine that I gave out a 15 question multiple choice test with 5 possible answers per question. Using random guessing, what is the probability of getting greater than 7 questions correct? This is our prior answer Here we are summing 7:15
  • 36. Imagine that a population of students take a test with an average score of 78 and a standard deviation of 9. Assuming the test scores are normally distributed, how many students received a 90 or higher?
  • 37.
  • 38. Imagine that a population 100 Students take a test with an average score of 78 and a standard deviation of 9. Assuming the test scores are normally distributed, how many students received a 90 or higher?
  • 39. Imagine that a population 100 Students take a test with an average score of 78 and a standard deviation of 9. Assuming the test scores are normally distributed, how many students received a 90 or higher? pnorm(q , mean= ,  sd= , lower.tail=TRUE) This is the Syntax:
  • 40. Imagine that a population 100 Students take a test with an average score of 78 and a standard deviation of 9. Assuming the test scores are normally distributed, how many students received a 90 or higher? pnorm(q , mean= ,  sd= , lower.tail=TRUE) This is the Syntax: pnorm(90 , mean= 78 ,  sd=9 , lower.tail=FALSE) What We Want: because we want upper tail
  • 41. Imagine that a population 100 Students take a test with an average score of 78 and a standard deviation of 9. Assuming the test scores are normally distributed, how many students received a 90 or higher? pnorm(q , mean= ,  sd= , lower.tail=TRUE) This is the Syntax: pnorm(90 , mean= 78 ,  sd=9 , lower.tail=FALSE) What We Want: because we want upper tail
  • 42. In the 2011-2012 year the national average on the LSAT was 150.66 with a Standard Deviation of 10.19 Assuming those scores are normally distributed, what percentage of test takers scored 160 or above? http://www.lsac.org/docs/default-source/ research-%28lsac-resources%29/tr-12-03.pdf Table 1 on Page 9
  • 43. In the 2011-2012 year the national average on the LSAT was 150.66 with a Standard Deviation of 10.19 Assuming those scores are normally distributed, what percentage of test takers scored 160 or above? http://www.lsac.org/docs/default-source/ research-%28lsac-resources%29/tr-12-03.pdf Table 1 on Page 9
  • 46. H0: There is No Difference Between the Mean Damage Award in Bloom County and the Mean Damage Award in the Rest of the State Num of Obs. Mean Std. Dev. GROUP 1 Rest of State 21 $371,621 $289,823 GROUP 2 Bloom County 25 $547,784 $703,314
  • 47. Given the sample size we might consider a T-Test
  • 48. But We Need To Check For Normality
  • 49. Okay this means we need to use a non-parametric test Good News is that is Available in
  • 50. This is tricky because we have do not have even sized samples Also the Sample is Pretty Small As reported on Page 274 of Lawless, et. al.
  • 52. Male Female Totals Not Research Asst 319 323 642 Research Assistant 60 34 94 Total 379 357 736 RA’s Hired at a School are mostly Men 60 out of 94 RA’s are Men (See Above) Could this just be chance or is it too large to be explained by chance? Chi Square ( ) Statisticχ 2
  • 53. Male Female Totals Not Research Asst 319 323 642 Research Assistant 60 34 94 Total 379 357 736
  • 56.
  • 57. Daniel Martin Katz @ computational computationallegalstudies.com lexpredict.com danielmartinkatz.com illinois tech - chicago kent college of law@