Title: | Scientific Analysis of Trial Errors (SATE) |
---|---|
Description: | Bundles functions used to analyze the harmfulness of trial errors in criminal trials. Functions in the Scientific Analysis of Trial Errors ('SATE') package help users estimate the probability that a jury will find a defendant guilty given jurors' preferences for a guilty verdict and the uncertainty of that estimate. Users can also compare actual and hypothetical trial conditions to conduct harmful error analysis. The relationship between individual jurors' verdict preferences and the probability that a jury returns a guilty verdict has been studied by Davis (1973) <doi:10.1037/h0033951>; MacCoun & Kerr (1988) <doi:10.1037/0022-3514.54.1.21>, and Devine et el. (2001) <doi:10.1037/1076-8971.7.3.622>, among others. |
Authors: | Barry Edwards [aut, cre] |
Maintainer: | Barry Edwards <[email protected]> |
License: | CC0 |
Version: | 2.2.1 |
Built: | 2024-12-05 14:00:01 UTC |
Source: | CRAN |
Calculates the probability that jury of size jury_n finds defendant guilty given on preferences of jury pool (inputted as sample_pg). Does not estimate uncertainty (use as.jury.stats function for inferential statistics).
as.jury.point( sample_pg, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15 )
as.jury.point( sample_pg, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15 )
sample_pg |
Proportion of jurors who favor a guilty verdict. Can be a single number between 0 and 1, or a vector of such numbers. |
jury_n |
Size of the jury (i.e. 6, 8, or 12); default value is 12. |
pstrikes |
Number of peremptory strikes by prosecution; default value is 0. |
dstrikes |
Number of peremptory strikes by defendant; default value is 0. |
accuracy |
Accuracy of parties' peremptory strikes; a number between 0 and 1; default value is .15. |
Returns the probability jury finds defendant guilty (if sample_pg is a single number) or vector of such probabilities (if sample_pg is a vector).
library(sate) as.jury.point(sample_pg = .50) as.jury.point(sample_pg = 10/12)
library(sate) as.jury.point(sample_pg = .50) as.jury.point(sample_pg = 10/12)
Calculates probability jury finds defendant guilty based on verdicts preferences of jury pool. Also reports standard error and confidence interval of estimate (use as.jury.point function for estimate only).
as.jury.stats( sample_pg, sample_n, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15, digits = 3 )
as.jury.stats( sample_pg, sample_n, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15, digits = 3 )
sample_pg |
Proportion of jurors who favor a guilty verdict; a number between 0 and 1. |
sample_n |
Size of sample used to estimate sample_pg. |
jury_n |
Size of the jury (i.e. 6, 8, or 12); default value is 12. |
pstrikes |
Number of peremptory strikes by prosecution; default value is 0. |
dstrikes |
Number of peremptory strikes by defendant; default value is 0. |
accuracy |
Accuracy of parties' peremptory strikes; a number between 0 and 1; default value is .15. |
digits |
Number of digits to report after decimal places; default value is 3. |
Returns the probability jury finds defendant guilty.
library(sate) as.jury.stats(sample_pg=.50, sample_n=830) as.jury.stats(sample_pg=10/12, sample_n=295)
library(sate) as.jury.stats(sample_pg=.50, sample_n=830) as.jury.stats(sample_pg=10/12, sample_n=295)
Calculates jury-level statistics and differences based on juror-level statistics supplied by user.
compare.jury.stats( pg_actual, n_actual, pg_hypo, n_hypo, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15, digits = 3 )
compare.jury.stats( pg_actual, n_actual, pg_hypo, n_hypo, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15, digits = 3 )
pg_actual |
The proportion of jurors who favor a guilty verdict in the actual trial condition (the trial with error). |
n_actual |
The size of the sample used to estimate pg_actual. |
pg_hypo |
The proportion of jurors who favor a guilty verdict in the hypothetical trial condition (the fair trial without error). |
n_hypo |
The size of the sample used to estimate pg_hypo. |
jury_n |
Size of the jury (i.e. 6, 8, or 12); default value is 12. |
pstrikes |
Number of peremptory strikes by prosecution; default value is 0. |
dstrikes |
Number of peremptory strikes by defendant; default value is 0. |
accuracy |
Accuracy of parties' peremptory strikes; a number between 0 and 1; default value is .15. |
digits |
Number of digits to report after decimal places; default value is 3. |
Returns a list of jury-level statistics to assess effect of a trial error. Returned list includes statistics for actual jury, hypothetical jury, and the difference between them.
library(sate) compare.jury.stats(pg_actual=.70, n_actual=400, pg_hypo=.60, n_hypo=450) compare.jury.stats(pg_actual=.75, n_actual=450, pg_hypo=.65, n_hypo=350, jury_n=6, pstrikes=3, dstrikes=3)
library(sate) compare.jury.stats(pg_actual=.70, n_actual=400, pg_hypo=.60, n_hypo=450) compare.jury.stats(pg_actual=.75, n_actual=450, pg_hypo=.65, n_hypo=350, jury_n=6, pstrikes=3, dstrikes=3)
The deliberate function returns a jury verdict based on a simulation of deliberation as a modified tug-of-war between two verdict factions. Can be called directly, but is meant to be called many times to generate verdict probabilities based on g_votes and jury_n values.
deliberate(g_votes, jury_n)
deliberate(g_votes, jury_n)
g_votes |
Initial number of votes for guilty verdict (same as K value). |
jury_n |
Size of the jury (i.e. 4, 6, 8, 12, or 16). |
Returns "G" (guilty verdict) or "NG" (not guilty verdict).
library(sate) deliberate(g_votes=10, jury_n=12) deliberate(g_votes=4, jury_n=6)
library(sate) deliberate(g_votes=10, jury_n=12) deliberate(g_votes=4, jury_n=6)
The deliberate function returns a jury verdict based on a simulation of deliberation as a tug-of-war between two verdict factions. The civil version of deliberate does not have presumption in favor of either party. Can be called directly, but is meant to be called many times to generate verdict probabilities based on p_votes and jury_n values.
deliberate.civil(p_votes, jury_n)
deliberate.civil(p_votes, jury_n)
p_votes |
Initial number of votes for plaintiff. |
jury_n |
Size of the jury (i.e. 4, 6, 8, 12, or 16). |
Returns "P" (plaintiff verdict) or "D" (defendant verdict).
library(sate) deliberate.civil(p_votes=8, jury_n=12) deliberate.civil(p_votes=5, jury_n=6)
library(sate) deliberate.civil(p_votes=8, jury_n=12) deliberate.civil(p_votes=5, jury_n=6)
Calculates a vector probabilities that a jury with n_jurors will return a guilty verdict. The vector represents P(G|k) for 0, 1, 2, ... , n_jurors where k is the number of jurors initially in favor of guilty verdict.
get_pG_by_k(n_jurors = 6)
get_pG_by_k(n_jurors = 6)
n_jurors |
Size of the jury (i.e. 6, 8, or 12); default value is 6. |
Returns a vector of probabilities for guilty verdict of size n_jurors + 1.
library(sate) get_pG_by_k(10) get_pG_by_k(n_jurors=12)
library(sate) get_pG_by_k(10) get_pG_by_k(n_jurors=12)
Plots jury-level differences based on juror-level statistics supplied by user. Point estimates supplemented by confidence intervals. Effect-on-defendant also plotted.
graph.effect.defendant( pg_actual, n_actual, pg_hypo, n_hypo, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15 )
graph.effect.defendant( pg_actual, n_actual, pg_hypo, n_hypo, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15 )
pg_actual |
The proportion of jurors who favor a guilty verdict in the actual trial condition (the trial with error). |
n_actual |
The size of the sample used to estimate pg_actual. |
pg_hypo |
The proportion of jurors who favor a guilty verdict in the hypothetical trial condition (the fair trial without error). |
n_hypo |
The size of the sample used to estimate pg_hypo. |
jury_n |
Size of the jury (i.e. 6, 8, or 12); default value is 12. |
pstrikes |
Number of peremptory strikes by prosecution; default value is 0. |
dstrikes |
Number of peremptory strikes by defendant; default value is 0. |
accuracy |
Accuracy of parties' peremptory strikes; a number between 0 and 1; default value is .15. |
No return (creates plots)
library(sate) graph.effect.defendant(pg_actual=.70, n_actual=400, pg_hypo=.60, n_hypo=450) graph.effect.defendant(pg_actual=.75, n_actual=450, pg_hypo=.65, n_hypo=350, jury_n=6, pstrikes=3, dstrikes=3)
library(sate) graph.effect.defendant(pg_actual=.70, n_actual=400, pg_hypo=.60, n_hypo=450) graph.effect.defendant(pg_actual=.75, n_actual=450, pg_hypo=.65, n_hypo=350, jury_n=6, pstrikes=3, dstrikes=3)
Plots probability of guilty verdict with confidence interval based on juror-level statistics supplied by user. Similar to graph.effect.defendant, but plots one condition.
graph.estimate( sample_pg, sample_n, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15 )
graph.estimate( sample_pg, sample_n, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15 )
sample_pg |
The proportion of jurors who favor a guilty verdict in the sample condition |
sample_n |
The size of the sample used to estimate sample_pg_actual |
jury_n |
Size of the jury (i.e. 6, 8, or 12); default value is 12. |
pstrikes |
Number of peremptory strikes by prosecution; default value is 0. |
dstrikes |
Number of peremptory strikes by defendant; default value is 0. |
accuracy |
Accuracy of parties' peremptory strikes; a number between 0 and 1; default value is .15. |
No return (creates plot)
library(sate) graph.estimate(sample_pg=.70, sample_n=400) graph.estimate(sample_pg=.75, sample_n=450, jury_n=6, pstrikes=3, dstrikes=3)
library(sate) graph.estimate(sample_pg=.70, sample_n=400) graph.estimate(sample_pg=.75, sample_n=450, jury_n=6, pstrikes=3, dstrikes=3)
Calculates and returns probability distribution of initial votes for guilty verdict from 0:jury_n with options for peremptory strikes and strike accuracy. To select jury without strikes, keep pstrikes=0 and dstrikes=0.
select.with.strikes( p_g, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15 )
select.with.strikes( p_g, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15 )
p_g |
The proportion of jurors in the jury pool who favor a guilty verdict |
jury_n |
Size of the jury (i.e. 6, 8, or 12); default value is 12. |
pstrikes |
Number of peremptory strikes by prosecution; default value is 0. |
dstrikes |
Number of peremptory strikes by defendant; default value is 0. |
accuracy |
Accuracy of parties' peremptory strikes; a number between 0 and 1; default value is .15. |
A vector of probabilities for 0:jury_n initial guilty votes
library(sate) select.with.strikes(p_g=.70, jury_n=6) select.with.strikes(p_g=.75, jury_n=12, pstrikes=6, dstrikes=10)
library(sate) select.with.strikes(p_g=.70, jury_n=6) select.with.strikes(p_g=.75, jury_n=12, pstrikes=6, dstrikes=10)
Returns estimate of the probability of guilty verdict based on juror-level statistics supplied by user. Also reports inferential statistics. Results are based on an empirical model with greater uncertainty than as.jury.stats function.
sim.as.jury.stats( sample_pg, sample_n, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15, digits = 3, nDraws = 10000, seed = 12345 )
sim.as.jury.stats( sample_pg, sample_n, jury_n = 12, pstrikes = 0, dstrikes = 0, accuracy = 0.15, digits = 3, nDraws = 10000, seed = 12345 )
sample_pg |
The proportion of jurors who favor a guilty verdict in the jury pool |
sample_n |
The size of the sample used to estimate sample_pg |
jury_n |
Size of the jury (i.e. 6, 8, or 12); default value is 12. |
pstrikes |
Number of peremptory strikes by prosecution; default value is 0. |
dstrikes |
Number of peremptory strikes by defendant; default value is 0. |
accuracy |
Accuracy of parties' peremptory strikes; a number between 0 and 1; default value is .15. |
digits |
Number of digits to report after decimal places; default value is 3. |
nDraws |
The number of simulations used to generate results. Should be very large number (default = 10000). |
seed |
Set seed for random number generation for replication, default is 12345. |
Returns a list of jury-level statistics to assess effect of a trial error.
library(sate) sim.as.jury.stats(sample_pg=.50, sample_n=830, nDraws=500) sim.as.jury.stats(sample_pg=10/12, sample_n=295, pstrikes=6, dstrikes=10, nDraws=1000)
library(sate) sim.as.jury.stats(sample_pg=.50, sample_n=830, nDraws=500) sim.as.jury.stats(sample_pg=10/12, sample_n=295, pstrikes=6, dstrikes=10, nDraws=1000)
Calculates jury-level differences based on juror-level statistics supplied by user. Results based on empirical data, inferential statistics produced via simulations.
sim.compare.jury.stats( pg_actual, n_actual, pg_hypo, n_hypo, jury_n = 12, digits = 3, pstrikes = 0, dstrikes = 0, accuracy = 0.15, seed = 12345, nDraws = 10000 )
sim.compare.jury.stats( pg_actual, n_actual, pg_hypo, n_hypo, jury_n = 12, digits = 3, pstrikes = 0, dstrikes = 0, accuracy = 0.15, seed = 12345, nDraws = 10000 )
pg_actual |
The proportion of jurors who favor a guilty verdict in the actual trial condition (the trial with error). |
n_actual |
The size of the sample used to estimate pg_actual. |
pg_hypo |
The proportion of jurors who favor a guilty verdict in the hypothetical trial condition (the fair trial without error). |
n_hypo |
The size of the sample used to estimate pg_hypo. |
jury_n |
Size of the jury (i.e. 6, 8, or 12); default value is 12. |
digits |
Number of digits to report after decimal places; default value is 3. |
pstrikes |
Number of peremptory strikes by prosecution; default value is 0. |
dstrikes |
Number of peremptory strikes by defendant; default value is 0. |
accuracy |
Accuracy of parties' peremptory strikes; a number between 0 and 1; default value is .15. |
seed |
Set seed for random number generation for replication, default is 12345. |
nDraws |
The number of simulations used to generate results. Should be very large number (default = 10000). |
Returns a list of jury-level statistics to assess effect of a trial error.
library(sate) sim.compare.jury.stats(pg_actual=.70, n_actual=400, pg_hypo=.60, n_hypo=450, nDraws=500) sim.compare.jury.stats(pg_actual=.75, n_actual=450, pg_hypo=.65, n_hypo=350, seed=12345, nDraws=1000)
library(sate) sim.compare.jury.stats(pg_actual=.70, n_actual=400, pg_hypo=.60, n_hypo=450, nDraws=500) sim.compare.jury.stats(pg_actual=.75, n_actual=450, pg_hypo=.65, n_hypo=350, seed=12345, nDraws=1000)