Last updated: 2024-09-16

Checks: 7 0

Knit directory: PODFRIDGE/

This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20230302) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 6176bd3. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    data/.DS_Store
    Ignored:    output/.DS_Store

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/final_equation.Rmd) and HTML (docs/final_equation.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 6176bd3 tinalasisi 2024-09-16 Cleaning up repo and adding license.
html bce5e2e hcvw 2024-05-27 Build site.
Rmd 332d5a2 hcvw 2024-05-27 wflow_publish(c("analysis/CODIS_DB_composition.Rmd", "analysis/final_equation.Rmd",

Equation for the probability of an individual being detected

The probability of an individual being detected in the database is comprised of three separate probabilities: (1) the probability of the individual being in the database, (2) the probability of being detected due to one or both parents being in the database, and (3) the probability of being detected due to one or more siblings being present in the database.

  1. The probability of the individual being in the database: This is simply the probability of being in the database based on the individuals race and state of residency, which is located in the table on the CODIS database racial composition page.
  2. The probability of the individual being detected due to one or both parents being present in the database: This probability is the same as 1 minus the probability that neither parents are in the database, which is \((1-P(\text{present}_\text{par}))^2\), where \(P(\text{present}_\text{par})\) is the probability is the probability that the parent is in the database. For simplicity, we assume that the risk of being in the database is the same for all age groups (i.e., \(P(\text{present}_\text{par}) = P(\text{present}_\text{self})\)).
  3. The probability of the individual being detected due to a sibling being present in the database: This probability is more complicated because of population heterogeneity in the number of siblings per person and a probability of less than 1 that an individual is detected due to their sibling being present in the database due to shared allele frequencies among siblings. To calculate this probability, we first sum over the probability of having \(n\) siblings for \(n=1\) through \(n=11\), the largest number of siblings we have data on. For the probability of having \(n\) siblings for Black/African American or white individuals, see “Siblings Analysis”. Within each number of siblings, we sum over the probability of being detected for each possible number of siblings that are in the database. For example, if an individual has 3 siblings, we must account for them having 0, 1, 2, or all 3 siblings in the database, then the probability of being detected given all these possibilities. This is taken by calculating the binomial distribution for each possible number of siblings in the database \(i\), for the total \(n\) siblings, which is equivalent to \(\binom{n}{i}P(\text{present}_{\text{sib}})^{i} (1-P(\text{present}_{\text{sib}}))^{n-i}(1-(1-P(\text{detected} | \text{present}_{\text{sib}})^{i}))\). Similar to the probability of an individual being detected due to either parents being in the CODIS database, the probability of being detected due to \(i\) siblings being in the database is given by \((1-(1-P(\text{detected} | \text{present}_{\text{sib}})^{i}))\).

\[P(\text{detected}) = P(\text{present}_{\text{self}}) + (1-(1-P(\text{present}_\text{par}))^2) + \] \[\sum_{n=1}^{12}\left[P(n_{sib} = n)\sum_{i=1}^{n}\binom{n}{i}P(\text{present}_{\text{sib}})^{i} (1-P(\text{present}_{\text{sib}}))^{n-i}(1-(1-P(\text{detected} | \text{present}_{\text{sib}})^{i}))\right] \]


sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: x86_64-apple-darwin20
Running under: macOS Sonoma 14.6.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Detroit
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] workflowr_1.7.1

loaded via a namespace (and not attached):
 [1] vctrs_0.6.5       httr_1.4.7        cli_3.6.3         knitr_1.48       
 [5] rlang_1.1.4       xfun_0.45         stringi_1.8.4     processx_3.8.4   
 [9] promises_1.3.0    jsonlite_1.8.8    glue_1.7.0        rprojroot_2.0.4  
[13] git2r_0.33.0      htmltools_0.5.8.1 httpuv_1.6.15     ps_1.7.7         
[17] sass_0.4.9        fansi_1.0.6       rmarkdown_2.27    jquerylib_0.1.4  
[21] tibble_3.2.1      evaluate_0.24.0   fastmap_1.2.0     yaml_2.3.9       
[25] lifecycle_1.0.4   whisker_0.4.1     stringr_1.5.1     compiler_4.4.1   
[29] fs_1.6.4          pkgconfig_2.0.3   Rcpp_1.0.12       rstudioapi_0.16.0
[33] later_1.3.2       digest_0.6.36     R6_2.5.1          utf8_1.2.4       
[37] pillar_1.9.0      callr_3.7.6       magrittr_2.0.3    bslib_0.7.0      
[41] tools_4.4.1       cachem_1.1.0      getPass_0.2-4