prostate %>%
  mutate(aa = factor(aa, levels = c(0,1),
                     labels = c("White", "African-American"))) %>%
  mutate(fam_hx = factor(fam_hx, levels = c(0,1),
                         labels = c("No Family History", "FHx of Prostate Cancer"))) ->
  prostate_factors
prostate %>%
  select(age, p_vol, preop_psa, aa, fam_hx) %>%
  group_by(aa, fam_hx) %>%
  summarize(across(age:preop_psa, ~ mean(.x, na.rm = TRUE)))
## `summarise()` has regrouped the output.
## ℹ Summaries were computed grouped by aa and fam_hx.
## ℹ Output is grouped by aa.
## ℹ Use `summarise(.groups = "drop_last")` to silence this message.
## ℹ Use `summarise(.by = c(aa, fam_hx))` for per-operation grouping
##   (`?dplyr::dplyr_by`) instead.
## # A tibble: 4 × 5
## # Groups:   aa [2]
##      aa fam_hx   age p_vol preop_psa
##   <dbl>  <dbl> <dbl> <dbl>     <dbl>
## 1     0      0  61.8  56.9      8.06
## 2     0      1  59.5  57.3      7.22
## 3     1      0  60.7  54.3      9.90
## 4     1      1  60.1  51.4      8.71

Mean preoperative PSA levels were highest among African-American patients without a family history of prostate cancer (9.90 ng/mL), followed by African-American patients with a positive family history (8.70 ng/mL). White patients demonstrated lower mean preoperative PSA levels, both in those without a family history (8.05 ng/mL) and those with a positive family history (7.22 ng/mL).

ggplot(prostate_factors) +
  aes(x = p_vol, y = preop_psa, col = aa) +
  geom_point() +
  geom_smooth(method = "lm") +
  facet_grid(aa ~ fam_hx) +
  labs(x = 'Prostate Volume', y = "Preoperative PSA",
       title = 'Relationship Between Prostate Volume and Preop PSA,\nSubdivided by Family History and Race') +
  theme(legend.position = "bottom")
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 11 rows containing non-finite outside the scale range
## (`stat_smooth()`).
## Warning: Removed 11 rows containing missing values or values outside the scale range
## (`geom_point()`).

On visual inspection, across both racial groups, patients without a family history of prostate cancer exhibited higher preoperative PSA levels and greater prostate volume compared to those with a positive family history. However, formal statistical testing would be required to confirm this observation.

Analysis of Prostate Data

prostate %>%
  summarise(
    mean_age = mean(age, na.rm = TRUE),
    min_age = min(age, na.rm = TRUE),
    max_age = max(age, na.rm = TRUE),
    sd_age = sd(age, na.rm = TRUE)
  )
##   mean_age min_age max_age   sd_age
## 1 61.15728    38.4      79 7.240269

The study cohort had a mean age of 61 years (SD: X, range: 38–79 years).

Headline about Prostate Data

The majority of patients in this cohort had no family history of prostate cancer. A smaller proportion reported a positive family history, which appeared associated with lower preoperative PSA levels across both racial groups.

Statistical Testing

Prior to formal statistical testing, descriptive analysis suggested that patients without a family history of prostate cancer demonstrated higher preoperative PSA levels and greater prostate volume compared to those with a positive family history, regardless of racial background. An independent samples t-test was subsequently conducted to assess the statistical significance of PSA differences between racial groups.

prostate_factors %>%
  t_test(formula = preop_psa ~ aa,
         detailed = TRUE)
## # A tibble: 1 × 15
##   estimate estimate1 estimate2 .y.    group1 group2    n1    n2 statistic      p
## *    <dbl>     <dbl>     <dbl> <chr>  <chr>  <chr>  <int> <int>     <dbl>  <dbl>
## 1    -1.89      7.86      9.75 preop… White  Afric…   259    54     -1.96 0.0534
## # ℹ 5 more variables: df <dbl>, conf.low <dbl>, conf.high <dbl>, method <chr>,
## #   alternative <chr>

An independent samples t-test was conducted to compare preoperative PSA levels between African-American and White patients. Preoperative PSA levels were higher in African-American patients (mean = 9.74 ng/mL) compared to White patients (mean = 7.86 ng/mL), with a mean difference of 1.88 ng/mL (95% CI: -0.03 to 3.81, p = 0.053). This difference did not reach statistical significance, though the trend towards higher PSA levels in African-American patients is consistent with existing literature and may warrant further investigation in a larger cohort.