Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BronchStop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
twillia2
BronchStop
Commits
1ed6757b
Commit
1ed6757b
authored
2 months ago
by
twillia2
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
87800253
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
maternal_VE_study/BronchStop_screening_logs_analysis.R
+59
-0
59 additions, 0 deletions
maternal_VE_study/BronchStop_screening_logs_analysis.R
with
59 additions
and
0 deletions
maternal_VE_study/BronchStop_screening_logs_analysis.R
0 → 100644
+
59
−
0
View file @
1ed6757b
##Script to create recruitment flowchart for BronchStop VE manuscript##
## Thomas Williams, University of Edinburgh ##
## January 2025 ##
#load packages
library
(
readxl
)
library
(
dplyr
)
library
(
tidyverse
)
#set working directory
setwd
(
"TBC"
)
#create list of files
file_list
<-
list.files
(
path
=
"TBC"
)
#create empty dataframe
screening_log_df
<-
data.frame
()
#loop to read in data, specify columns you want
for
(
i
in
1
:
length
(
file_list
)){
temp_data
<-
read_excel
(
file_list
[
i
],
range
=
cell_cols
(
"A:G"
))
print
(
file_list
[
i
])
screening_log_df
<-
rbind
(
screening_log_df
,
temp_data
)
}
#change column names
screening_log_tidy_headers
<-
screening_log_df
%>%
rename
(
vaccine_eligible
=
`Vaccine eligible infant?* (Y/N) (if NO, data not required)`
)
%>%
rename
(
consented
=
`Mother Consented Y/N`
)
%>%
rename
(
reason_not_consented
=
`If Mother Not Consented, Reason`
)
%>%
rename
(
ID
=
`BRONCHSTART ID (If applicable)`
)
#convert all lower case to upper case
screening_log_tidy_headers
$
consented
<-
toupper
(
screening_log_tidy_headers
$
consented
)
#screen out cases were not eligible for Bronchstop and those that are yet to be contacted, often contain phrase "call next week or similar"
screening_log_BronchStop
<-
screening_log_tidy_headers
%>%
filter
(
vaccine_eligible
==
"Y"
)
%>%
filter_at
(
vars
(
consented
),
all_vars
(
!
is.na
(
.
)))
%>%
filter
(
!
grepl
(
"still to contact"
,
Notes
))
%>%
filter
(
!
grepl
(
"HAS PIS still trying to contact"
,
Notes
))
%>%
filter
(
!
grepl
(
"to be contacted"
,
Notes
))
%>%
filter
(
!
grepl
(
"For a call next week"
,
Notes
))
#now look at reasons for exclusion
flowchart_results_screening
<-
screening_log_BronchStop
%>%
group_by
(
consented
,
reason_not_consented
,
Notes
)
%>%
count
(
consented
)
#now create table for flowchart
flowchart_for_paper
<-
screening_log_BronchStop
%>%
group_by
(
consented
,
reason_not_consented
)
%>%
count
(
consented
)
#write to file
write.csv
(
flowchart_for_paper
,
file
=
"TBC"
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment