这是我的数据子集
dput(head(AMC))
structure(list(`NCT Number` = c("NCT03987958", "NCT02809092",
"NCT02860793", "NCT04069208", "NCT02319135", "NCT02920008"),
Status = c("Recruiting", "Active, not recruiting", "Completed",
"Recruiting", "Completed", "Completed"), `Study Results` = c("No Results Available",
"No Results Available", "No Results Available", "No Results Available",
"No Results Available", "No Results Available"), Conditions = c("Acute Myeloid Leukemia",
"Acute Myeloid Leukemia", "Acute Myeloid Leukemia", "Acute Myeloid Leukemia",
"Acute Myeloid Leukemia", "Acute Myeloid Leukemia"), Interventions = c(NA,
"Biological: NK Cells + Chemotherapy Starting", "Other: Bone marrow aspiration|Other: Blood sampling",
"Drug: Idarubicin and cytarabine induction", "Drug: Azacitadine|Drug: Fludarabine|Drug: Cytarabine|Drug: Lenograstim|Drug: Filgastrim",
"Drug: guadecitabine|Drug: Treatment Choice (TC)"), Gender = c("All",
"All", "All", "All", "All", "All"), Age = c("18 Years and older (Adult, Older Adult)",
"2 Years to 59 Years (Child, Adult)", "18 Years and older (Adult, Older Adult)",
"18 Years to 60 Years (Adult)", "65 Years and older (Older Adult)",
"18 Years and older (Adult, Older Adult)"), Phases = c(NA,
"Phase 1|Phase 2", "Not Applicable", "Phase 2", "Phase 3",
"Phase 3"), Enrollment = c(100, 30, 10, 42, 289, 302), `Study Type` = c("Observational",
"Interventional", "Interventional", "Interventional", "Interventional",
"Interventional"), `Study Designs` = c("Observational Model: Cohort|Time Perspective: Prospective",
"Allocation: N/A|Intervention Model: Single Group Assignment|Masking: None (Open Label)|Primary Purpose: Treatment",
"Allocation: N/A|Intervention Model: Single Group Assignment|Masking: None (Open Label)|Primary Purpose: Basic Science",
"Allocation: N/A|Intervention Model: Single Group Assignment|Masking: None (Open Label)|Primary Purpose: Treatment",
"Allocation: Randomized|Intervention Model: Parallel Assignment|Masking: None (Open Label)|Primary Purpose: Treatment",
"Allocation: Randomized|Intervention Model: Parallel Assignment|Masking: None (Open Label)|Primary Purpose: Treatment"
)), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame"
))############################################################################
head(AMC)
# A tibble: 6 x 11
`NCT Number` Status `Study Results` Conditions Interventions Gender Age Phases Enrollment `Study Type` `Study Designs`
<chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <dbl> <chr> <chr>
1 NCT03987958 Recruit… No Results Avai… Acute Myel… NA All 18 Year… NA 100 Observation… Observational Model: …
2 NCT02809092 Active,… No Results Avai… Acute Myel… Biological: NK Cel… All 2 Years… Phase… 30 Interventio… Allocation: N/A|Inter…
3 NCT02860793 Complet… No Results Avai… Acute Myel… Other: Bone marrow… All 18 Year… Not A… 10 Interventio… Allocation: N/A|Inter…
4 NCT04069208 Recruit… No Results Avai… Acute Myel… Drug: Idarubicin a… All 18 Year… Phase… 42 Interventio… Allocation: N/A|Inter…
5 NCT02319135 Complet… No Results Avai… Acute Myel… Drug: Azacitadine|… All 65 Year… Phase… 289 Interventio… Allocation: Randomize…
6 NCT02920008 Complet… No Results Avai… Acute Myel… Drug: guadecitabin… All 18 Year… Phase… 302 Interventio… Allocation: Randomize…我如何总结数据,将第一栏分开,这是我对地图的参考。
如果我把地位、性别或年龄等因素放在一起,那是直接的,但在包含干预措施的栏目中,则由多个词组合而成。我也希望看到这一情况得到总结。
因此,在第一栏中,我的目标是查看数据摘要。
如何去做,任何建议或帮助都将不胜感激。
预期输出
table(AMC$Status,AMC$`Study Results`, AMC$`Study Type`)
, , = Expanded Access
Has Results No Results Available
Active, not recruiting 0 0
Approved for marketing 0 2
Available 0 3
Completed 0 0
Enrolling by invitation 0 0
No longer available 0 2
Not yet recruiting 0 0
Recruiting 0 0
Suspended 0 0
Terminated 0 0
Unknown status 0 0
Withdrawn 0 0
, , = Expanded Access:Individual Patients
Has Results No Results Available
Active, not recruiting 0 0
Approved for marketing 0 1
Available 0 2
Completed 0 0
Enrolling by invitation 0 0
No longer available 0 2
Not yet recruiting 0 0
Recruiting 0 0
Suspended 0 0
Terminated 0 0
Unknown status 0 0
Withdrawn 0 0以上是我的预期产出。但似乎很难把所有的变量,除了第一个在一个表或一个表,因为有许多水平,我看到。但它能转化成更简洁的东西吗?而不是做桌子
发布于 2021-01-13 08:33:39
下面是一个基本的R解决方案,它的函数ftable经常被遗忘。
ftable(AMC$Status,AMC$`Study Results`, AMC$`Study Type`)
# Interventional Observational
#
#Active, not recruiting No Results Available 1 0
#Completed No Results Available 3 0
#Recruiting No Results Available 1 1https://stackoverflow.com/questions/65697322
复制相似问题