> For the complete documentation index, see [llms.txt](https://jordan-lab.gitbook.io/irt-for-crc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jordan-lab.gitbook.io/irt-for-crc/polygenic-risk-scores/analyzing-the-results.md).

# Analyzing the results

## Evaluation metrics

The base-maf (base minor allele frequency) and maf (target minor allele frequency) filters were toggled with. However, there was no difference in the evaluation metrics obtained.

R2 was obtained from the summary file generated by PRSice as described [previously](/irt-for-crc/polygenic-risk-scores/prsice.md#output).

Using a merged dataframe containing phenotype, age, sex, and PRS, AUC is computed as follows in R:

<pre class="language-r" data-overflow="wrap"><code class="lang-r"># Compute AUC for only PRS
auc_prs &#x3C;- roc(df$PHENO, df$PRS)$auc

<strong># Create GLM for PRS, age, and sex
</strong><strong>prs_model &#x3C;- glm(PHENO ~ PRS + Age + Sex, data = df, family = binomial)
</strong><strong>
</strong><strong># Get predicted probabilities from the model
</strong>predicted_probs &#x3C;- predict(prs_model, type = "response")

# Compute combined AUC
auc_combined &#x3C;- roc(df$PHENO, predicted_probs)$auc

# Print combined AUC
print(auc_combined)
</code></pre>

| Evaluation metrics    | PGS000074 | PGS000785 |
| --------------------- | --------: | --------: |
| R2                    |    0.0505 |    0.0576 |
| AUC (only PRS)        |    0.5783 |    0.6058 |
| AUC (PRS + age + sex) |    0.6976 |    0.7095 |

## Distribution plots

|                                                                                                      PGS000074                                                                                                      |                                                                                                           PGS000785                                                                                                          |
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| ![](https://2627783047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdWPEE7njK8FE2uu7kAHm%2Fuploads%2FhmSfFE6fXfJJSeFJL2Dl%2Fimage.png?alt=media\&token=9eff008e-3178-4f84-8c6a-d1a3519eb576) | ![](https://2627783047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdWPEE7njK8FE2uu7kAHm%2Fuploads%2F6f2Sv9q5CsHSKxEEeKeH%2FPGS000785_dist.png?alt=media\&token=29d1ff5d-38fa-4ea9-9be3-a32926e0feea) |

## Odds ratio plots

|                                                                                                                                           PGS000074                                                                                                                                          |                                                                                                                        PGS000785                                                                                                                       |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| <img src="https://2627783047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdWPEE7njK8FE2uu7kAHm%2Fuploads%2F3sOMYtM0RZO1Buf4Gvo5%2FPGS000074_results_STRATA_PLOT_2023-06-27.png?alt=media&amp;token=791fa7f5-36aa-4e7f-85e1-547a32446efc" alt="" data-size="original"> | ![](https://2627783047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdWPEE7njK8FE2uu7kAHm%2Fuploads%2FBQU2w1mAL6LAGr3ckleg%2FPGS000785_results_STRATA_PLOT_2023-06-27.png?alt=media\&token=12e158bf-fbb7-4c5e-95f3-4f6669a180f3) |
