Skip to content

Commit

Permalink
testing1
Browse files Browse the repository at this point in the history
  • Loading branch information
lemanska committed Oct 25, 2023
1 parent 0f4e2e6 commit c691625
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions analysis/Descriptive_trends.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ xx <- c("preva","ageP","sdP","inci","ageI","sdI",
"inci17","ageI17","sdI17","inci18","ageI18","sdI18",
"inci19","ageI19","sdI19","inci20","ageI20","sdI20",
"inci21","ageI21","sdI21","inci22","ageI22","sdI22",
"inci23","ageI23","sdI23")
"inci23","ageI23","sdI23","m1","m2")
Table1[xx] <- NA
Table1[1,"preva"] <- plyr::round_any(length(which(Input$prostate_ca==1)), 5, f = round)
Table1[1,"ageP"] <- round(mean(Input$age_pa_ca),n)
Expand Down Expand Up @@ -230,14 +230,16 @@ xl <- Input3$age_pa_ca; Table1[1,"sdI22"] <- paste0(round(sd(xl),n),
round(t.test(xl)$conf.int[2],n),")"); rm(Input2)


Input2 <- Input[Input$prostate_ca_date>= "2023-01-01" & Input$prostate_ca_date<= "2023-07-31",]
Input2 <- Input[Input$prostate_ca_date>= "2023-01-01" & Input$prostate_ca_date<= "2023-12-31",]
Table1[1,"inci23"] <- plyr::round_any(length(which(Input2$prostate_ca==1)), 5, f = round)
Table1[1,"ageI23"] <- paste0(round(mean(Input2$age_pa_ca),n)," (p=",
round(t.test(Input3$age_pa_ca,Input2$age_pa_ca)$p.value,3),")")
round(t.test(Input2$age_pa_ca,Input3$age_pa_ca)$p.value,3),")")
xl <- Input2$age_pa_ca; Table1[1,"sdI23"] <- paste0(round(sd(xl),n),
" (95CIs: ",round(t.test(xl)$conf.int[1],n)," to ",
round(t.test(xl)$conf.int[2],n),")"); rm(Input3)
round(t.test(xl)$conf.int[2],n),")"); #rm(Input3)

Table1[1,"m1"] <-mean(Input2$age_pa_ca)
Table1[1,"m2"] <-mean(Input3$age_pa_ca)

Table1 <- t(Table1)
Table1 <- as.data.frame(Table1)
Expand Down

0 comments on commit c691625

Please sign in to comment.