Skip to main content
PLOS ONE logoLink to PLOS ONE
. 2023 Mar 31;18(3):e0279076. doi: 10.1371/journal.pone.0279076

Predicting a diagnosis of ankylosing spondylitis using primary care health records–A machine learning approach

Jonathan Kennedy 1,*, Natasha Kennedy 1, Roxanne Cooksey 1, Ernest Choy 2, Stefan Siebert 3, Muhammad Rahman 1, Sinead Brophy 1
Editor: Alfredo Vellido4
PMCID: PMC10065228  PMID: 37000839

Abstract

Ankylosing spondylitis is the second most common cause of inflammatory arthritis. However, a successful diagnosis can take a decade to confirm from symptom onset (via x-rays). The aim of this study was to use machine learning methods to develop a profile of the characteristics of people who are likely to be given a diagnosis of AS in future. The Secure Anonymised Information Linkage databank was used. Patients with ankylosing spondylitis were identified using their routine data and matched with controls who had no record of a diagnosis of ankylosing spondylitis or axial spondyloarthritis. Data was analysed separately for men and women. The model was developed using feature/variable selection and principal component analysis to develop decision trees. The decision tree with the highest average F value was selected and validated with a test dataset. The model for men indicated that lower back pain, uveitis, and NSAID use under age 20 is associated with AS development. The model for women showed an older age of symptom presentation compared to men with back pain and multiple pain relief medications. The models showed good prediction (positive predictive value 70%-80%) in test data but in the general population where prevalence is very low (0.09% of the population in this dataset) the positive predictive value would be very low (0.33%-0.25%). Machine learning can be used to help profile and understand the characteristics of people who will develop AS, and in test datasets with artificially high prevalence, will perform well. However, when applied to a general population with low prevalence rates, such as that in primary care, the positive predictive value for even the best model would be 1.4%. Multiple models may be needed to narrow down the population over time to improve the predictive value and therefore reduce the time to diagnosis of ankylosing spondylitis.

Introduction

Ankylosing Spondylitis (AS) affects 1 in 400 [1] people and is the second most common cause of inflammatory arthritis after rheumatoid arthritis (RA). AS is characterized by spinal (axial) inflammation; however, the presentation of the disease differs between men and women, with women reported to have less structural radiographic changes and higher erythrocyte sedimentation rate (ESR) (indicating inflammation) compared to men [2]. The introduction of effective treatment options for AS, such as tumour necrosis factor (TNF) inhibitors [3, 4], means it has become imperative to identify the disease as early as possible to treat patients early in the course of the disease. However, as chronic low back pain is one the most common presenting symptoms in primary care, it is difficult to identify these patients among the far larger pool of people with non-specific chronic low back pain. New advances in imaging, especially in magnetic resonance imaging (MRI), has allowed the earlier recognition of inflammatory change before the irreversible radiographic changes that are used to diagnose AS. However, the early inflammatory changes also detect people who never go on to develop AS or any radiographic changes. The Assessment of SpondyloArthritis Society (ASAS) classification criteria [5] recognises this and patients can fulfil a classification of axial spondyloarthritis (SpA), which incorporates both AS and non-radiographic axial SpA [6]. The ASAS criteria utilise x-rays, MRI and/or clinical and laboratory features to classify patients as having axial SpA with a sensitivity of 68–87%, and specificity of 62–95% against rheumatologist diagnosis [7, 8]; at follow-up a positive predictive value of 93.3% was obtained for the patient being diagnosed with axial SpA at 3–5 years. However, only 5% of patients with non-radiographic axial SpA will progress to AS at 4 years follow-up, indicating a 5% positive predictive value for identifying AS [6]. The positive predictive value increases to 12% if elevated C-Reactive Protein (CRP) levels and active sacroiliitis on MRI are present [6]. This implies that identifying axial SpA alone does not help to identify early or pre-AS and so is not a strong predictor of progression to AS. While many patients with non-radiographic axial SpA will require treatment based on their level of symptoms, it is important to identify early those who will go on to develop radiographic progression (i.e. AS) as these changes are irreversible and associated with greater functional limitation. However, predicting those who develop radiographic damage (AS) using traditional methods remains difficult due to the requirement for longitudinal data.

This study aimed to undertake a new approach in predicting the development of AS. The expansion of Big Data and high performance computing enables routinely-collected patient records to be linked, thus, enabling the patient journey to be tracked through the health care system over long periods of time [9]. Novel machine learning methods can potentially identify patterns and clusters of terms/data, such as diagnosis, procedures, and medications, which are observed more frequently in people who have a subsequent diagnosis of AS, compared to people who do not receive a diagnosis of AS. However, the underlying theories in data-driven methods for prediction are very different from those of traditional causal modelling. Predictive modelling looks for associations with the outcome but is not looking to minimise confounders or look for causal pathways. This means factors which are predictive of an outcome may bear little relation to factors that are on the causal pathway for that outcome (for example, multiple blood tests for liver function may be predictive of a diagnosis of arthritis due to association with medication, but are not related to the causal pathway for arthritis). This study uses machine-learning to identify diagnostic codes, medications, procedures and administrative data of patients who are given a future diagnosis of AS compared to controls and examines the patient journey through the National Health Service (NHS) for people with AS.

Materials and methods

Dataset

The Secure Anonymised Information Linkage (SAIL) databank is a national (Wales, United Kingdom) data repository which allows person-based data linkage across datasets. This databank includes Welsh primary care (general practitioner, GP) data, hospital in- and out-patient records, as well as mortality data collected by the Office of National Statistics (ONS). SAIL comprises over a billion anonymised records. It employs a split-file approach to ensure anonymisation and overcome issues of confidentiality and disclosure in health-related data warehousing. Demographic data is sent to a partner organisation, NHS Wales Informatics Service, where identifiable information is removed; clinical data are sent directly to the SAIL Databank and each individual is assigned an encrypted Anonymised Linking Field (ALF). The ALF is utilised to link anonymised individuals across datasets, facilitating longitudinal analysis of an individual’s journey through multiple health, education and social datasets [10].

Data collected by GPs is captured via Read Codes (5-digit codes related to diagnosis, medication, and process of care codes) [10]. The secondary care dataset utilised in this study is from the clinical system, Cellma by Riomed [9], employed in the rheumatology departments of local hospital heath boards; Swansea Bay University Health Board (SBU—Swansea, Neath and Bridgend areas), and Cardiff and Vale University Health Board (CVUHB). This commercial system applies SNOMED-CT to code diagnosis and medications [9], as well as recording clinical data entered by rheumatologists at the point of clinical contact. The Cellma systems were available in the SBU region from March 2009 until October 2012, and in Cardiff from October 2013 to July 2014. Hospital in- and out-patient data are collected in the Patient Episode Database for Wales, which contains clinical information regarding patients’ hospital admissions, discharges, diagnoses and operations utilising the International Classification of Diseases (ICD-10) clinical coding system. The ONS mortality dataset contains demographic data, place of death and underlying cause of death (also ICD-10).

Ethical approval

Data held in the SAIL databank are anonymised, consequently, no ethical approval is required. All data contained in SAIL has permission from the relevant Caldicott Guardian or Data Protection Officer. SAIL-related projects are required to obtain Information Governance Review Panel (IGRP) approval and this study had governance approval.

Patient selection and definition

Early pilot investigation demonstrated differences in the presentation of AS for men compared to women, for example women had less back pain codes but more pain medication codes. For this reason, the data was stratified so that analysis was run separately for males and females. The raw data was selected and then cleaned before matching AS patients with the general population.

Patients with AS were selected as cases and people from the general population without AS were selected as controls. A person was selected as having AS if they had a diagnosis of AS in the GP data (Read code N100), hospital admissions (ICD10 code M45) or Rheumatology clinical system. The controls from the general population were selected as those with no evidence of AS or axial SpA within their records (see Fig 1). People with AS were included if they were diagnosed between the ages of 15 and 35 years (this age was chosen in line with the NICE pathway [11], diagnosed after the year 2000 and were registered with a Welsh GP a minimum of 3 years before the AS diagnosis date (some had 7+ years of data but the minimum dataset was 3 years). These criteria were chosen to ensure there was sufficient high quality data to map the patient journey prior to the diagnosis of AS. These restrictions meant that of 5751 AS male patients identified (see S1 Fig), 543 (9.4%) males with full patient records were used in developing the model (380 in model creation, 163 in testing the prediction of the model) and 250 (9.2%) of the 2702 females with AS (see S2 Fig) were used in the model (175 in developing the model, 75 in testing the prediction of the model). In this study, 10% (n = 543/5751) of patients were used to develop the model and the remaining patients with a diagnosis between the ages of 15 to 35 years (n = 1559/5751, 27% of total) were used to examine the generalizability of the model. This means 63% of the data was not used in the analysis as these patients were diagnosed with AS before the age of 15 or after the age of 35.

Fig 1. Overview of analysis.

Fig 1

The date of diagnosis of AS was recorded as the first mention of AS in GP, hospital admission or rheumatology records. An earlier ‘suspected AS’ date was recorded if patients were prescribed an anti-TNF inhibitor before the first mention of AS, or if the patient had a record for an HLA-B27 test or a diagnosis of “spondyloarthropathy” and subsequent diagnosis of “AS”. The presence of HLA-B27 can also be associated with other conditions such as uveitis. Finally, the AS patients were matched 1 to 100 with controls in the general population. Matches were on diagnosis date (for the AS case) and an equivalent time date selected at random (for controls), sex and week of birth (within 6 months). All selected general population controls were required to have 3 years of GP data before and after the random date to limit the chance of misclassification of AS. Therefore, the patients have to survive at least 6 years to be in the control dataset and they need to survive at least 3 years to be in the AS dataset. People who had less than 6 years of data in the GP system could not be selected as controls.

Feature construction for analysis

All healthcare data is recorded at set points in time (e.g. date of GP appointment) even though it may reflect ongoing treatment and care. In addition, the high complexity of the data results in very long data processing times. Both these issues can be overcome by running the analysis at slices in time separately, e.g. an unspecific back pain code present between age 15 and 20 AND a pelvic pain codes present between age 25 and 30. This enables a time step pathway of codes which become relevant as the disease develops. This work can identify the difference between codes found before, after and overlapping the incident date of diagnosis.

In routine data some important codes, such as diagnosis, may have only one occurrence, while some common codes, such as procedures (e.g. blood pressure check), may be recorded very frequently. This means procedure codes will end up having a higher weighting in any signal detection compared to diagnosis. To minimise the influence of certain codes being highly abundant (e.g. prescriptions) and other codes only appearing once or twice (e.g. diagnosis), the variables are expressed in a binary form; e.g. any code for diagnosis of iritis, any mention of a prescription of NSAID between age 15 to 20. In this example, the frequency of a diagnosis code of iritis may be 1 and the frequency of NSAID code may be 12 prescriptions but both are recorded in the data set as a binary “1” i.e. present.

Another issue with routine data is that coding can go to very specific details and levels, such as one code for suspension preparation and another code for tablet preparation of the same drug. For this reason the analysis was repeated to examine all levels of codes, with every level examined separately. Additionally, codes are aggregated so that concepts can be included in the features (e.g. a “pain” code flag may aggregate all the specific pain codes (pain in left thumb and pain in lumbar spine) into one combined “pain present” code. Finally, the laboratory test codes used in this analysis were simply “had test”, but the test result was not analysed. The ability to interpret and use the test results (using the laboratory dataset) was beyond the scope of this work.

All the codes were labelled so they could be analysed to distinguish the origin of the code (i.e. hospital or GP or specialist clinical dataset), number of characters in the code (which gives the level of specificity), and time (e.g. between the ages of 15 and 20 years).

Statistical analysis

Feature/Variable selection

Participants were split into a training (70%) and a testing (30%) group for the male (S1 Fig) and female (S2 Fig) cohorts. The different stages of the analysis were undertaken 100 times with the same affected AS case patient compared with 100 different matched controls taken from the general population. Hence, the Chi-squared tests were run in batches of (a) AS cases (n = 380 (male), n = 175 (female)) vs. general population control 1 (n = 380 (male), n = 175 (female)), (b) AS cases (n = 380 (male), n = 175 (female)) vs. general population control 2 (n = 380 (male), n = 175 (female)), this was repeated for all 100 controls. The intention of this method was to compare the AS cohort to a representative sampling of individuals with the general population. Therefore, one AS patient characteristic was represented in 100 tests; 79300 tests were run for all 793 AS patients and 100 controls each for the male and female cohorts. Then, the first stage of the analysis (see Fig 1) utilised Chi-squared tests to identify which codes were more frequent in the AS or the control at each time point (e.g. every year). Thus, 100 Chi-squared tests were run for each of the 3 years preceding the diagnosis date (700 chi-squared tests), to identify significant differences between the frequencies of presence and absence of selected codes in AS compared to general population patients. A code was taken as being associated with AS (or not associated with AS but associated with general population) if it achieved a significance level 1% (p < 0.01) in 90% of the chi-squared tests for males and in 75% of chi-square test for females (as we had a lower sample size and so lower power in females), for the time point selected. The codes that reached this level of significance were taken forward to be included in logistic regression tests. To remain in the logistic regression model, a code needed to have 1% significance (p < 0.01). This list of significant variables was then transformed utilising principal component analysis to better understand the structure and relationship of the features to each other.

Model development

The principal components were then utilised to create a decision tree to better understand subgroups identified within the analysis. An individual decision tree was identified for each of the 100 cohorts under investigation. To select the most predictive model, the prediction of the model was compared with the training dataset raw data and the models with the highest F value are selected. The models were compared with the 100 match pair groups (e.g. AS vs. general population control 1, AS vs. general population control 2 etc.). This resulted in 100 training models being identified. The model selected is the one with the highest average F value across the 100 runs.

Model validation

The selected model is applied to the testing dataset and its effectiveness (e.g. sensitivity, specificity, Positive Predictive Value, Negative Predictive Value) is recorded.

Model generalisablity

The model was then used to predict AS development in the general population to identify those who went on to develop AS but had not met the minimum level of data inclusion criteria to be included in the model development.

Results

Predictive features

The model developed for the male and female cohorts assesses the codes at different ages and weights them to give an overall total score for the individual (see S1 and S2 Tables). For example, an individual who is male aged 20 to 25, who hasan ESR test, diagnosis of musculoskeletal or connective tissue diseases, prescribed NSAIDs, with many laboratory procedures and has a previous history of vertebral column syndromes at age 15 to 20, would score highly for suspected AS. In general, the predictive features identified included;

  • Musculoskeletal diagnosis.

  • Pain codes.

  • Pain medications

  • Blood tests.

  • X-rays of the spine.

  • Uveitis.

Codes associated with a musculoskeletal diagnosis at a younger age (e.g. age 15–20) were associated with a higher chance of a future diagnosis of AS. In temporal order these early conditions were then followed by investigations (e.g. laboratory tests such as lymphocyte count, ESR test) at age 20 to 25 before being associated with the development of AS. In contrast, laboratory procedures between 30 and 35 years were weighted by the model as less likely to be associated with AS. This aspect might be partially associated with the selection cut off criteria for the cohort creation.

Women with AS had a greater number of additional musculoskeletal diagnoses and increased numbers of diagnoses from hospitals (S2 Table); suggesting that women have a more complicated path to being diagnosed with AS, with multiple tests, diagnoses, and referrals, compared to men with AS.

The codes encompassing pain and pain drugs are also significant features. The pain codes were predominantly general pain and specific back pain without radiation. Within the model, a young male or female attending the GP with prolonged pain and given pain relief medication is weighted as a higher chance of AS.

Numerous blood tests were identified as predictors for the AS model; these are utilised as an investigative tool to ascertain causes of symptoms experienced by the patient. In clinical practice, these tests are undertaken in a batch process to identify causes, as well as markers of other conditions, thus reducing the possible diagnosis. The codes associated with rheumatoid factor (a test to identify if the patient might have RA), are present for males and females; however, women are more likely to be given the test earlier than men. This is likely due to AS symptoms in females being suspected as a result of other conditions, such as RA.

The males with AS in the study had x-rays of the spine between the ages 15 to 20 while women generally did not have x-rays until aged 25 and 30. Instead, women were more likely to have codes for sciatica, back pain, and prescriptions for pain relief between 20 and 25 years old, and older. This may imply that there is an increased reluctance to consider a diagnosis of AS or to perform spinal or pelvic x-rays for young female patients compared to their male counterparts.

Uveitis is a significant extra-articular manifestation in people with AS [12]. However, this only appeared as a feature in the male population in our cohort using this method. There was a smaller female cohort for analysis, which could have meant the study was underpowered to detect uveitis as a predictor in women.

Decision tree for male cohort

The principal components analyses were models of features/variables that were weighted to give a final score for an individual. These models were combined into decision trees. The tree for males (Fig 2) shows that if their principal component A score is above 0.769, they would have a high chance of an AS diagnosis (see Fig 2.M1) in the future (this model will identify people who have had symptoms from teenage years). If their score is lower than 0.769 then they were considered using principal components model B, where a very low score (less than 0.006 (see Fig 2.M3)) or a very high score (more than 1.341 (see Fig 2.M2)) would indicate a high chance of AS. A very low score in principal component B would be someone with multiple tests when they are aged 25 to 30 including rheumatoid factor, radiographs, x-rays, and taking pain killer drugs. A very high score would be someone taking NSAIDs when young (prescribed diclofenac/ ibuprofen when aged 15 to 20). However, a score in principal component model B between 0.006 and 1.341 (see Fig 2.M4) would mean they are less likely to have AS (e.g. blood tests were when they were 30 and they have no history of problems when they were 15 to 20). The model validation (i.e. predictive value in the 30% test data split) is presented in Tables 13 showing a positive predictive value of 76.69%.

Fig 2. Combined results of machine learning (male).

Fig 2

Table 1. Training and testing results (male).

Sensitivity (%) Specificity (%) Positive Predictive Value (%) Negative Predictive Value (%) Accuracy (%) F Value (%)
Training 59.74 81.76 76.65 67.00 70.75 67.14
Testing 60.74 81.45 76.69 67.46 71.09 67.77
Validation 21.43 82.25 0.15 99.88 82.17 0.30

Table 3. Male excluding training and testing data.

  PREDICTED  
  AS NON_AS  
OBSERVED AS 339 1243 21.43%
NON_AS 229815 1064605 82.25%
  0.15% 99.88% 82.17%

Table 2. Male all population.

  PREDICTED  
  AS NON_AS  
OBSERVED AS 765 1337 36.39%
NON_AS 229815 1064605 82.25%
  0.33% 99.87% 82.17%

Decision tree for female cohort

The decision tree generated for the female cohort was more complex and had six possible outcomes (see Fig 3), four with higher chances of developing AS and two associated with lower chances of developing AS. In Fig 3.F1, the node is associated with a high value (>2.138) using principal component C and is associated with a higher probability of AS. This node is related to codes within the years 20 to 25 for back pain, NSAIDs, and blood tests. This is also related to a group of codes between 25 to 30 years age, including; diclofenac sodium, radiology, vertebral column syndromes, and other back disorders. This implies that this group of patients present with back pain and are being investigated at 20 to 25 years, but x-rays and diagnosis of AS might not be made until they are 25 to 30 years old.

Fig 3. Combined results of machine learning (female).

Fig 3

Female patients that correspond to Fig 3.F2 have features at 25 to 30 years for backache symptoms, laboratory tests, and diclofenac sodium. This is then followed by NSAIDs and musculoskeletal diagnosis at 30 to 35 years old. Like node F there are additional diagnosis of musculoskeletal conditions prior to AS diagnosis and it takes several years for a successful diagnosis, albeit at a later age than for Fig 3.F1.

Fig 3.F2 is also predictive of AS and is characterised by features across three age groups. The first group is related to joint pain between 20 and 25 years old. This is followed by x-rays of the spine at 25 to 30 years old and then diclofenac sodium at 30 and 35 years old. This grouping also points to a prolonged time between initial symptoms and a successful diagnosis of AS. Fig 3.F3 is also predictive of AS and has codes at a young age followed by a very long time to successful diagnosis. There are codes for arthropathies at age 15 to 20 years old. This is followed by features at 25 to 30 years old for sciatica and co-dydramol tablets.

The Fig 3.F4 node represents a non-AS prediction and is associated with a lower score using principal component C which suggests having laboratory tests (serum CRP level, plasma viscosity, ESR, enzymes/specific proteins) undertaken at age 15 to 20 years old. Node Fig 3.F6 is the other non-AS group and the patients within it were characterised by not being similar to the other groups.

Taken together this model suggests multiple pathways before obtaining a diagnosis for women with AS. The positive predictive value of the model for female patients was 78.3% in the testing dataset (see Tables 46).

Table 4. Training and testing results (female).

Sensitivity (%) Specificity (%) Positive Predictive Value (%) Negative Predictive Value (%) Accuracy (%) F Value (%)
Training 48.57 88.43 80.77 63.23 68.50 60.66
Testing 45.33 87.44 78.30 61.53 66.39 57.42
Validation 52.72 87.99 0.25 99.97 87.97 0.50

Table 6. Female excluding training and testing data.

  PREDICTED  
  AS NON_AS  
OBSERVED AS 223 280 44.33%
NON_AS 158025 1158198 87.99%
0.14% 99.98% 87.98%

ROC curves

The following ROC curves (Figs 4 and 5) show the results of the male and female groups under investigation. The area under the curve for the male cohort is 0.870519215 and the female cohort has an area under the curve of 0.863183728.

Fig 4. ROC curve (male only).

Fig 4

AUC (area under curve) = 0.870519215.

Fig 5. ROC curve (female only).

Fig 5

AUC (area under curve) = 0.863183728.

Model generalizability

The model was the applied to the unused individuals who had been removed though the selection criteria (see S1 and S2 Figs). These AS patients were grouped with all the individuals in the GP system that had no AS within their history and have 1 or more days of data between the age of 15 and 35 (i.e. the model was validated on the general GP population in Wales with the individual who were used to develop the model removed, therefore giving a lower than normal prevalence of AS in the validation dataset).

The results for the model generalizability are shown in Tables 13 (male) and Tables 46 (female). The specificity achieved in this was comparable to the training/testing cohorts (82% (male) 88% (female), while the sensitivity was lower (21% in males and 52% in females). This is likely due to the general population cohort having incomplete coverage of data compared to the other cohorts. The positive predictive value is considerably lower in the general population cohort dataset as this is dependent on the prevalence of the condition in the population. As a result of the way it was defined, in the general population cohort dataset 0.09% of the population had AS compared to 1% in the (1 to 100 controls) in the test dataset. There were some codes that were only found in the female analysis (see S3 Table) such as sciatica and rheumatoid factor at a younger age, and some codes only found in the male analysis, such as uveitis.

“Perfect” model vs. developed model

To be able to determine the reliability and accuracy of a machine learning model on general population data, the mode of assessment needs to be put in context. The model will be assessed against a “perfect” model to be able to determine if the model can be considered successful. If we make the assumption that a “perfect” model would have 90% sensitivity and specificity as higher percentages than this would likely be attributed to overfitting of the model. The most important comparison point is the positive predictive value, as this will determine the ratio of correctly characterised patients. The equation for positive predictive value is;

PercentageofAS=(TotalobservedAS+incorrectlypredictedAS)Totalpopulation

The prevalence in the datasets, using the “perfect” model for males (see Table 7) would have obtained a positive predictive value of 1.44%, (based on prevalence rates seen in the validation dataset) compared to 0.33% which was obtained with our model (see Table 5). The percentage of AS cases identified for the “perfect” model was 10.1% (i.e. a high rate of false positives), while in our model this was 17.9%. Therefore, these results indicate that both models err in identifying too many suspected AS cases (which are not truly AS). This is likely due to the inclusion of commonly used codes in the GP records, such as pain codes.

Table 7. Perfect model output (male).

PREDICTED
AS NON_AS
OBSERVED AS 1891.8 210.2 90.00%
NON_AS 129442 1164978 90.00%
1.44% 99.98% 90.00%

Table 5. Female all population.

  PREDICTED  
  AS NON_AS  
OBSERVED AS 397 356 52.72%
NON_AS 158025 1158198 87.99%
  0.25% 99.97% 87.97%

The female population obtained a positive predictive value of 0.51% for the “perfect” model (see Table 8), while the positive predictive value for our model was 0.25% (Table 5). The percentage of the “perfect” model identified 10% of the dataset as AS compared to 12% for the model created. These features identify the female model as being closer to the “perfect” model than the male model. This implies that the female model is more accurate than the male model at identifying patients with AS.

Table 8. Perfect model output (female).

PREDICTED
AS NON_AS
OBSERVED AS 677.7 75.3 90.00%
NON_AS 131622.3 1184601 90.00%
0.51% 99.99% 90.00%

Discussion

AS is an important inflammatory musculoskeletal condition with effective therapy available, especially if identified early. However, there is no single diagnostic test for AS and symptoms over-lap with many other more common conditions, especially non-specific low back pain. Machine learning offers a new way of approaching the early identification of people with AS and to address the delayed diagnosis that characterises this condition, especially for women [13]. The findings from this study showed that although machine learning methods can achieve very high positive predictive value within test datasets, it must be recognised that with low prevalence of AS in the general population, the positive predictive value in general and primary care clinical settings will always be very low.

The model to predict AS development performed well with 76.69%-78.3% positive predictive value within the test sets, which is equivalent to other publications in this field and equivalent to that predicting AxS [13]. The developed model performed better for women with AS than for men. In general it pointed to symptom presentation for women in the age range of 20–30 (which differs from men who present with back pain in their teens). The women present with pain, unspecified back disorders, musculoskeletal connective tissue disorders as coding items.

The ‘perfect’ model in females would have had positive predictive values of 1.4% and our model achieved a 0.25%, this suggests that not all the predictive variables have been captured in the dataset. The next stage would be to take the profiles of the decision trees forward so that we can identify people who fit the profile but are not diagnosed, and seek additional data about these patients from both medical records (e.g. results of laboratory tests such as elevated CRP) and to incorporate information directly from patients via an online patient reported measures questionnaire to capture more granularity and current symptoms (e.g. duration of pain, stiffness and pain worse in morning, pain improved with movement, buttock pain, hot burning joints, family history of SpA). This could help to develop a clinical tool using data driven methods that might be used online for GPs and/or patients to quantify the probability of AS in order to prioritise and target HLA-B27 testing and MRI scans, and suggest possible referral to a rheumatologist. However, further research would be needed to examine the cost-effectiveness of this strategy.

Limitations: machine-learning models are very dependent on data quality and accuracy. The results of laboratory tests were not used in this model as they were too complex to interpret in the time available. However, the addition of test results is another step that can be taken by future research to improve the prediction of the model. The use of machine learning in the health care field is still in its infancy and this work can be used as a step to improve this process and time to diagnosis, especially for women with AS who have not well studied or recognised.

The model was built using only 9% of all available cases as inclusion criteria selected only those with a diagnosis in the last 18 years and who have at least 3 years of data available for pre-diagnosis profiles. This is a very specific cohort of patients, as both the cases and controls needed to be alive for the study period and needed to stay resident in Wales and given the majority of the patients are young, this means those who are mobile (e.g. moved outside Wales for employment or education) are missing from the dataset. This means the model may be more likely to be based on the people who are more ill and not able to seek work outside of Wales. However, the same could be said for the control population who needed to have 6 years of continuous data (to ensure they did not have AS) to be eligible, so would also be likely to be a stable and relatively non-mobile population. Additionally, there can be a significant delay between onset of conditions and confirmed diagnosis, this can cause misclassification. The impact of this has been limited in the design of the dataset, however misclassification is still possible.

The model identifies a large variety of codes that are significant for identifying AS, however many other codes that would improve the positive predictive value have too low numbers to be useful for the machine learning model as they would be to specific. A further layer of detail could be applied with a more traditional methodology, such as including the results from lab tests, allowing stratification at a number of levels.

In clinical practice, one would want to identify all patients with axial SpA. However, our model utilised historical data and used only codes for AS (i.e. radiographic axial SpA), so did not include the more recent term non-radiographic axial SpA which is not incorporated in GP codes yet (but is in the rheumatology database). Including the full spectrum of axial SpA would incorporate greater heterogeneity but also increase the likelihood of early diagnosis (and therefore earlier treatment) and potentially increase the predictive value due to higher prevalence in the general population.

The models presented here identified the pathways through the health system experienced by people prior to being given the diagnosis of AS. The profiles indicate many codes for pain, drugs to relieve pain, related conditions, and testing for conditions. These features indicate a pattern of repeated interactions with healthcare providers prior to diagnosis. Patients with features fitting a profile of suspected AS could be flagged for consideration of an HLA-B27 test; if positive, a MRI, and possible referral to a rheumatologist for assessment with recommendation for appropriate exercises, smoking cessation, dietary advice and awareness of the increased possibility of associated eye, bowel and skin symptoms [14].

The AS male population can be characterised into 3 main groups;

  • Group 1- age under 20, have lower back pain, on medication (Diclofenac Sodium), may develop uveitis in their 20’s.

  • Group 2- Ages 20 to 25, back disorders, NSAIDs, blood tests

  • Group 3—Aged 25 to 30, numerous blood tests, various musculoskeletal codes, back pain and radiology.

The AS female population can be characterised into these separate groups;

  • Group 1- identifies individuals that have been identified with arthropathies at 15 to 20 years followed by pain in lumbar spine, co-dydramol and sciatica at 25 to 30 years.

  • Group 2—Aged 20 to 30; likely to be prescribed multiple pain medications, be diagnosed with musculoskeletal conditions and had various blood tests. This would evolve by age 25 to 30 years to more back pain codes, vertebral column syndrome, and additional pain relief

  • Group 3- identifies a pathway of pain/arthropathies at 20 to 25 years, followed by x-ray to attempt to identify the condition (25 to 30 years) and then Diclofenac Sodium at 30 to 35 years.

  • Group 4—Aged 25 to 30 years; This group includes backache symptoms and multiple blood tests.

The techniques presented in this paper created a simpler profile for male when compared to female participants, even though the female population is smaller. This might be due to AS developing in the teenage to early twenties, and males and females having a different healthcare usage at this age. With young men tending to have a much lower usage than females so will likely have a simpler profile in their healthcare record. An additional reason might be that the symptoms expressed in a male would be identified as AS quicker, compared to females who might investigate other conditions before AS, such as rheumatoid arthritis.

Additional criteria from the NICE pathway [11] which were not included in the dataset (as they require patient report) include waking during the second half of the night due to symptoms, pain improved with movement and a first degree relative with spondyloarthritis.

Further work could examine the cost effectiveness of using profiling to identify people for HLA-B27 and/or MRI testing and if positive referral to a rheumatologist. Similarly, excluding AS early may accrue healthcare savings by avoiding further unnecessary investigations and consultations.

Conclusions

This study indicates that machine learning has the potential to help identify people with AS and better understand their diagnostic journeys through the health system, but we need more detailed data to improve prediction and clinical utility.

This study demonstrates that models can be produced using only data recorded in medical records and can attain predictive values of 70–80% to identify people at risk of developing AS in test data, although in the general population the positive predictive value would only be 0.15%-0.25% due to the low prevalence of the condition. This may be improved by incorporating the wider axial SpA spectrum which has a higher prevalence.

Supporting information

S1 Fig. Male participants with AS.

(TIFF)

S2 Fig. Female participants with AS.

(TIFF)

S1 Table. Principal component analysis results for males.

(DOCX)

S2 Table. Principal component analysis results for females.

(DOCX)

S3 Table. Code identified in both male and female analysis, male only or female only.

(DOCX)

Abbreviations

ALF

Anonymised Linking Field

AS

ankylosing spondylitis

ASAS

Assessment of SpondyloArthritis Society

CRP

C-reactive protein

MRI

magnetic resonance imaging

NSAID

Non-steroidal anti-inflammatory drugs

SAIL

Secure Anonymised Information Linkage

SpA

spondyloarthritis, HLA-B27, GP, MRI

Data Availability

The data is owned by the SAIL Databank (https://saildatabank.com/) and all datasets are available from them upon request and appropriate information governance. The authors had no special access privileges to the data others would not have.

Funding Statement

This work was supported by UCB Pharma, Health Data Research UK, and the infrastructure support of the National Centre for Population Health and Wellbeing and the SAIL Databank. The funders had no input in to the study design, analysis or interpretation or writing up of the work.

References

  • 1.Khan MA., Calin A., Taurog J. Ankylosing spondylitis: clinical aspects. The sponyloarthritides.1998. [Google Scholar]
  • 2.de Jong H, Paramarta JE, de Winter J, Baeten D, van de Sande M. Differences between females and males in axial spondyloarthritis: data from a real-life cross-sectional cohort. Scand J Rheumatol. 2019: 1–5. doi: 10.1080/03009742.2019.1627410 [DOI] [PubMed] [Google Scholar]
  • 3.Braun J, Baraliakos X, Heldmann F, Kiltz U. Tumor necrosis factor alpha antagonists in the treatment of axial spondyloarthritis. Expert Opin Investig Drugs. 2014; 23(5): 647–59. doi: 10.1517/13543784.2014.899351 [DOI] [PubMed] [Google Scholar]
  • 4.van der Heijde D, Schiff MH, Sieper J, Kivitz AJ, Wong RL, Kupper H, et al. Adalimumab effectiveness for the treatment of ankylosing spondylitis is maintained for up to 2 years: long-term results from the ATLAS trial. Ann Rheum Dis. 2009; 68(6): 922–9. doi: 10.1136/ard.2007.087270 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.Rudwaleit M, van der Heijde D, Landewé R, Listing J, Akkoc N, Brandt J, et al. The development of Assessment of SpondyloArthritis international Society classification criteria for axial spondyloarthritis (part II): validation and final selection. Ann Rheum Dis. 2009; 68(6): 777–83. doi: 10.1136/ard.2009.108233 [DOI] [PubMed] [Google Scholar]
  • 6.Proft F, Poddubnyy D. Ankylosing spondylitis and axial spondyloarthritis: recent insights and impact of new classification criteria. Ther Adv Musculoskelet Dis. 2018; 10(5–6): 129–39. doi: 10.1177/1759720X18773726 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.van den Berg R, de Hooge M, van Gaalen F, Reijnierse M, Huizinga T, van der Heijde D. Percentage of patients with spondyloarthritis in patients referred because of chronic back pain and performance of classification criteria: experience from the Spondyloarthritis Caught Early (SPACE) cohort. Rheumatology (Oxford). 2015; 54(7): 1336. doi: 10.1093/rheumatology/kev208 [DOI] [PubMed] [Google Scholar]
  • 8.Tomero E, Mulero J, de Miguel E, Fernández-Espartero C, Gobbo M, Descalzo MA, et al. Performance of the Assessment of Spondyloarthritis International Society criteria for the classification of spondyloarthritis in early spondyloarthritis clinics participating in the ESPERANZA programme. Rheumatology (Oxford). 2014; 53(2): 353–60. doi: 10.1093/rheumatology/ket359 [DOI] [PubMed] [Google Scholar]
  • 9.Zhou SM, Fernandez Gutierrez F, Kennedy J, Cooksey R, Atkinson M, Denaxas S, et al. Defining Disease Phenotypes in Primary Care Electronic Health Records by a Machine Learning Approach: A Case Study in Identifying Rheumatoid Arthritis. PLOS One. May 2, 2016 doi: 10.1371/journal.pone.0154515 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Cooksey R, Brophy S, Kennedy J, Fernandez Gutierrez F, Pickles T, Davies R, et al. Cardiovascular risk factors predicting cardiac events are different in patients with rheumatoid arthritis, psoriatic arthritis, and psoriasis. Seminars in Arthritis and Rheumatism. Volume 48, Issue 3, 2018. December, Pages 367–373. 10.1016/j.semarthrit.2018.03.005 [DOI] [PubMed] [Google Scholar]
  • 11.Referral for suspected axial spondyloarthritis. NICE Pathways. Last updated 12 March 2019, 2020. [Google Scholar]
  • 12.Sun L, Wu R, Xue Q, Wang F, Lu P. Risk factors of uveitis in ankylosing spondylitis: An observational study. Medicine (Baltimore). 2016; 95(28): e4233. doi: 10.1097/MD.0000000000004233 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Walsh JA, Rozycki M, Yi E, Park Y. Application of machine learning in the diagnosis of axial spondyloarthritis. Curr Opin Rheumatol. 2019; 31(4): 362–7. doi: 10.1097/BOR.0000000000000612 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Brown M, Bradbury LA. New approaches in ankylosing spondylitis. Med J Aust. 2017; 206(5): 192–4. doi: 10.5694/mja16.01111 [DOI] [PubMed] [Google Scholar]

Decision Letter 0

Alfredo Vellido

16 Aug 2021

PONE-D-20-36921

Predicting a diagnosis of ankylosing spondylitis using primary care health records – a machine learning approach.

PLOS ONE

Dear Dr. Kennedy,

Thank you for submitting your manuscript to PLOS ONE. After careful consideration, we feel that it has merit but does not fully meet PLOS ONE’s publication criteria as it currently stands. Therefore, we invite you to submit a revised version of the manuscript that addresses the points raised during the review process.

Please submit your revised manuscript by Sep 30 2021 11:59PM. If you will need more time than this to complete your revisions, please reply to this message or contact the journal office at plosone@plos.org. When you're ready to submit your revision, log on to https://www.editorialmanager.com/pone/ and select the 'Submissions Needing Revision' folder to locate your manuscript file.

Please include the following items when submitting your revised manuscript:

  • A rebuttal letter that responds to each point raised by the academic editor and reviewer(s). You should upload this letter as a separate file labeled 'Response to Reviewers'.

  • A marked-up copy of your manuscript that highlights changes made to the original version. You should upload this as a separate file labeled 'Revised Manuscript with Track Changes'.

  • An unmarked version of your revised paper without tracked changes. You should upload this as a separate file labeled 'Manuscript'.

If you would like to make changes to your financial disclosure, please include your updated statement in your cover letter. Guidelines for resubmitting your figure files are available below the reviewer comments at the end of this letter.

If applicable, we recommend that you deposit your laboratory protocols in protocols.io to enhance the reproducibility of your results. Protocols.io assigns your protocol its own identifier (DOI) so that it can be cited independently in the future. For instructions see: http://journals.plos.org/plosone/s/submission-guidelines#loc-laboratory-protocols. Additionally, PLOS ONE offers an option for publishing peer-reviewed Lab Protocol articles, which describe protocols hosted on protocols.io. Read more information on sharing protocols at https://plos.org/protocols?utm_medium=editorial-email&utm_source=authorletters&utm_campaign=protocols.

We look forward to receiving your revised manuscript.

Kind regards,

Alfredo Vellido

Academic Editor

PLOS ONE

Journal Requirements:

When submitting your revision, we need you to address these additional requirements.

1. Please ensure that your manuscript meets PLOS ONE's style requirements, including those for file naming. The PLOS ONE style templates can be found at 

https://journals.plos.org/plosone/s/file?id=wjVg/PLOSOne_formatting_sample_main_body.pdf and 

https://journals.plos.org/plosone/s/file?id=ba62/PLOSOne_formatting_sample_title_authors_affiliations.pdf

2. We note that the grant information you provided in the ‘Funding Information’ and ‘Financial Disclosure’ sections do not match. 

When you resubmit, please ensure that you provide the correct grant numbers for the awards you received for your study in the ‘Funding Information’ section.

3. Thank you for stating the following in the Acknowledgments Section of your manuscript: 

"This study was funded by UCB. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript. 

The SAIL databank was used and all data used in this study are available through the SAIL application process, https://www.saildatabank.com/application-process. 

This work was supported by Health Data Research UK , which is funded by the UK Medical Research Council, Engineering and Physical Sciences Research Council, Economic and Social Research Council, Department of Health and Social Care (England), Chief Scientist Office of the Scottish Government Health and Social Care Directorates, Health and Social Care Research and Development Division (Welsh Government), Public Health Agency (Northern Ireland), British Heart Foundation and the Wellcome Trust."

We note that you have provided funding information that is not currently declared in your Funding Statement. However, funding information should not appear in the Acknowledgments section or other areas of your manuscript. We will only publish funding information present in the Funding Statement section of the online submission form. 

Please remove any funding-related text from the manuscript and let us know how you would like to update your Funding Statement. Currently, your Funding Statement reads as follows: 

This work was supported by Health Data Research UK , which is funded by the UK Medical Research Council, Engineering and Physical Sciences Research Council, Economic and Social Research Council, Department of Health and Social Care (England), Chief Scientist Office of the Scottish Government Health and Social Care Directorates, Health and Social Care Research and Development Division (Welsh Government), Public Health Agency (Northern Ireland), British Heart Foundation and the Wellcome Trust."

Please include your amended statements within your cover letter; we will change the online submission form on your behalf.

4. Thank you for stating the following in the Competing Interests section: 

"JK, SB reports grants from UCB Pharma, during the conduct of the study; and involved in (but not directly funded by) grants from Biogen, Sanofi and Novartis.

RC reports grants from Pfizer, during the conduct of the study; .

EC reports grants from UCB,  during the conduct of the study; grants and personal fees from Pfizer, grants and personal fees from UCB, grants from BioCancer, grants from Biogen, grants and personal fees from Novartis, grants and personal fees from Roche, personal fees from Amgen, personal fees from Chugai Pharma, personal fees from Eli Lilly, grants and personal fees from Sanofi, personal fees from Abbvie, personal fees from Janssen, personal fees from Gilead, personal fees from Bristol Myer Squibbs,  outside the submitted work;  In addition, Dr. Choy has a patent null pending.

SS reports grants and personal fees from AbbVie, grants and personal fees from UCB, grants and personal fees from Novartis, grants and personal fees from Janssen, grants and personal fees from Pfizer, grants from Bristol Myers Squibb,  from Boehringer-Ingelheim,  outside the submitted work."

Please confirm that this does not alter your adherence to all PLOS ONE policies on sharing data and materials, by including the following statement: "This does not alter our adherence to  PLOS ONE policies on sharing data and materials.” (as detailed online in our guide for authors http://journals.plos.org/plosone/s/competing-interests).  If there are restrictions on sharing of data and/or materials, please state these. Please note that we cannot proceed with consideration of your article until this information has been declared. 

Please include your updated Competing Interests statement in your cover letter; we will change the online submission form on your behalf.

5. We note that you have stated that you will provide repository information for your data at acceptance. Should your manuscript be accepted for publication, we will hold it until you provide the relevant accession numbers or DOIs necessary to access your data. If you wish to make changes to your Data Availability statement, please describe these changes in your cover letter and we will update your Data Availability statement to reflect the information you provide.

6. PLOS requires an ORCID iD for the corresponding author in Editorial Manager on papers submitted after December 6th, 2016. Please ensure that you have an ORCID iD and that it is validated in Editorial Manager. To do this, go to ‘Update my Information’ (in the upper left-hand corner of the main menu), and click on the Fetch/Validate link next to the ORCID field. This will take you to the ORCID site and allow you to create a new iD or authenticate a pre-existing iD in Editorial Manager. Please see the following video for instructions on linking an ORCID iD to your Editorial Manager account: https://www.youtube.com/watch?v=_xcclfuvtxQ.

7. Please upload a new copy of Figure 1 and figure supplemental 1 & 2. as the detail is not clear. Please follow the link for more information: https://blogs.plos.org/plos/2019/06/looking-good-tips-for-creating-your-plos-figures-graphics/" https://blogs.plos.org/plos/2019/06/looking-good-tips-for-creating-your-plos-figures-graphics/.

[Note: HTML markup is below. Please do not edit.]

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Author

1. Is the manuscript technically sound, and do the data support the conclusions?

The manuscript must describe a technically sound piece of scientific research with data that supports the conclusions. Experiments must have been conducted rigorously, with appropriate controls, replication, and sample sizes. The conclusions must be drawn appropriately based on the data presented.

Reviewer #1: Yes

Reviewer #2: Partly

**********

2. Has the statistical analysis been performed appropriately and rigorously?

Reviewer #1: Yes

Reviewer #2: Yes

**********

3. Have the authors made all data underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data—e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: Yes

Reviewer #2: Yes

**********

4. Is the manuscript presented in an intelligible fashion and written in standard English?

PLOS ONE does not copyedit accepted manuscripts, so the language in submitted articles must be clear, correct, and unambiguous. Any typographical or grammatical errors should be corrected at revision, so please note any specific errors here.

Reviewer #1: Yes

Reviewer #2: Yes

**********

5. Review Comments to the Author

Please use the space provided to explain your answers to the questions above. You may also include additional comments for the author, including concerns about dual publication, research ethics, or publication ethics. (Please upload your review as an attachment if it exceeds 20,000 characters)

Reviewer #1: 1. Introduction section can be extended to add the issues in the context of the existing work

2. Literature review techniques have to be strengthened by including the issues in the current system and how the author proposes to overcome the same.

3. What is the motivation of the proposed work?

4. Research gaps, objectives of the proposed work should be clearly justified.

5. The authors should consider more recent research done in the field of their study (especially in the years 2018 and 2020 onwards). 6. The paper needs to provide significant experimental details to correctly assess its contribution: What is the validation procedure used?

7. Kindly provide several references to substantiate the claim made in the abstract (that is, provide references to other groups who do or have done research in this area).

8. An error and statistical analysis of data should be performed.

9. The conclusion should state scope for future work.

10. Discuss the future plans with respect to the research state of progress and its limitations.

11. Kindly refer the below paper:

1. Rajput, D.S., Basha, S.M., Xin, Q. et al. Providing diagnosis on diabetes using cloud computing environment to the people living in rural areas of India. J Ambient Intell Human Comput (2021). https://doi.org/10.1007/s12652-021-03154-4

Reviewer #2: *** METHODOLOGY ***

Novel machine learning methods can potentially identify

-> Are any of the ML methods employed truly novel or designed for the purposes of the experiment? If not, remove the word "novel".

In this study, 10% (n=543/5751) of patients were used to develop the model and the remaining patients with a diagnosis between the ages of 15 to 35 years (n=1559/5751, 27% of total) were used to examine the generalizability of the model. This means 63% of the data was not used in

the analysis as these patients were diagnosed with AS before the age of 15 or after the age of 35.

-> The 5751 seems to be from the identified male patients. What about the female? Or am I misunderstanding, and this should be made clearer?

This means 63% of the data was not used in the analysis as these patients were diagnosed with AS before the age of 15 or after the age of 35.

-> The majority was not used. NICE was mentioned as the reasoning behind this decision, but you should offer a further discussion as to the benefits vs. detriments of effectively discarding this much data.

Additionally, codes are aggregated so that concepts can be included in the features (e.g. a “pain” code flag may aggregate all the specific pain codes (pain in left thumb and pain in lumbar spine) into one combined “pain present” code

-> Unless I am misunderstanding, how is it beneficial to aggregate all the pain responses into 1 feature? I'd think it would make more sense to have a "pain in AS-associated areas" and "pain in other areas". (I think you actually do this as elaborated later, but then this sentence needs to be better worded.)

*** MODEL ***

79300 tests were run for all 793 AS patients and 100 controls each for the male and female cohorts

-> Shouldn't this be 555 (380+175), or were you also using the data set aside for generalizability? If you were, please explain why, because this would seem somewhat problematic.

The model selected is the one with the highest average F value across the 100 runs.

-> Why select only 1 model? May there be a benefit to using the previous 100 training models together as a random forest?

This list of significant variables was then transformed utilising principal component analysis to better understand the structure and relationship of the features to each other.

-> More information on PCA is needed in the manuscript body, e.g. how many principle components were kept after the transform and why was that number selected? Arbitrary?

*** RESULTS AND ANALYSIS ***

Table 1

-> Validation PPV and F-score are very low (0.15% and 0.30% respectively)?

Table 4

-> Validation PPV and F-score are very low (0.25% and 0.50% respectively)?

If we make the assumption that a “perfect” model would have 90% sensitivity and specificity as higher

19 percentages than this would likely be attributed to overfitting of the model.

-> One could counter overfitting e.g. by making better use of a validation set during hyperparameter tuning/optimization. (But this is a small point that you needn't necessarily do anything with, I'm just saying >90% should be achievable without overfitting.)

This implies that the female model is more accurate than the male model at identifying patients with AS.

-> Could it have something to do with the fact more principle components seemed to be used? Please explain.

It must be recognised that with low prevalence of AS in the general population, the positive predictive value in general and primary care clinical settings will always be very low.

-> I don't think this is necessarily true -- a model with extremely high sensitivity and specificity should be able to achieve a relatively high PPV. However, I acknowledge there are some limitations of your specific study -- and perhaps the nature of your model -- that inhibit your model's ability to get a high PPV. Perhaps this can be better clarified in the manuscript body (but it's not detrimental if it cannot).

The results of laboratory tests were not used in this model as they were too complex to interpret in the time available

-> Do you mean the project development time or the 3 years of time before diagnosis or something else? This should be specified.

Thus, 100 Chi-squared tests were run for each of the 3 years preceding the diagnosis date (700 chi-squared tests)

-> You should better explain why 700 tests were required (the reasoning behind the number).

There is some discussion mixed into the results, e.g. "This may imply that there is an increased reluctance to consider a diagnosis of AS or to perform spinal or pelvic x-rays for young female patients compared to their male counterparts" or "suggesting that women have a more complicated path to being diagnosed with AS, with multiple tests, diagnoses, and referrals, compared to men with AS" or "however, women are more likely to be given the test earlier than men. This is likely due to AS symptoms in females being suspected as a result of other conditions, such as RA" or "There was a smaller female cohort for analysis, which could have meant the study was underpowered to detect uveitis as a predictor in women." Please have a separate Discussion section for these and like comments.

*** WHAT YOU NEED YET INCLUDE ***

What software package did you use to implement your models? What were your hardware specs? What's the runtime of the model(s) on the system? What is the filesize of the models?

Needs more background and cited works, especially about other machine/deep-learning related AS-diagnostic works regardless of their inputs (e.g. images, features derived from images). Include at least:

-> http://dx.doi.org/10.1186/s42358-020-00126-8

-> https://doi.org/10.1016/j.compmedimag.2020.101718

-> https://doi.org/10.1007/s10067-019-04553-x

Please provide an ROC curve for your models and report AUC. If possible, provide some statistical analysis on the ROC curve (e.g. bootstrapped confidence intervals).

*** POSSIBLE DISCUSSION POINTS ***

This is likely due to the general population cohort having incomplete coverage of data compared to the other cohorts.

-> For generalizability, what is the likelihood that any given patient with back pain has in their record all the utilized data/stats? What could be done about it if they are missing some of the stats?

*** POSSIBLE RESEARCH EXPANSION ***

What about taking only the most common stats (that would be in the record of most patients) and possibly a shorter history time frame and re-running the experiment? How might results differ? It would be interesting to see and possibly include, but if you feel it is too out of scope consider it for future work.

*** GRAMMAR AND WORD CHOICE ***

AS is an important inflammatory musculoskeletal condition with effective therapy available,

especially if identified early

-> Word choice: "important"? Important how so? A better word could be used here to convey the meeting you want, which admittedly was somewhat vague to me.

especially for women with AS who have not well studied or recognised.

-> Grammar and meaning: "especially for women with AS, who traditionally have had later diagnoses possibly due to other factors; this area requires further research."

an unspecific back pain code present between age 15 and 20 AND a pelvic pain codes present between age 25 and 30.

-> Grammar: between ages X and Y (also elsewhere); a pelvic pain code or pelvic pain codes.

who hasan ESR test

-> Grammar: has an

The model was the applied to the unused individuals

-> Grammar: The model was applied to...

*** OTHER ***

Maybe combine the supplementary figures and write XXX individuals as XXX/YYY individuals, explaining that XXX denotes male and YYY denotes female.

The next stage would be to take the profiles of the decision trees forward so that we can identify people who fit the profile but are not diagnosed, and seek additional data about these patients from both medical records (e.g. results of laboratory tests such as elevated CRP) and to incorporate information directly from patients via an online patient reported measures questionnaire to capture more granularity and current symptoms (e.g. duration of pain, stiffness and pain worse in morning, pain improved with movement, buttock pain, hot burning joints, family history of SpA)

-> Sounds reasonable!

In the discussion, I really liked how you characterized the male and female "warning signs" and proposed actionable steps toward diagnosis in clinical practice.

I enjoyed reading the article and hope you use my suggestions to make it the best it can be! Have a good day.

**********

6. PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: No

Reviewer #2: No

[NOTE: If reviewer comments were submitted as an attachment file, they will be attached to this email and accessible via the submission site. Please log into your account, locate the manuscript record, and check for the action link "View Attachments". If this link does not appear, there are no attachment files.]

While revising your submission, please upload your figure files to the Preflight Analysis and Conversion Engine (PACE) digital diagnostic tool, https://pacev2.apexcovantage.com/. PACE helps ensure that figures meet PLOS requirements. To use PACE, you must first register as a user. Registration is free. Then, login and navigate to the UPLOAD tab, where you will find detailed instructions on how to use the tool. If you encounter any issues or have any questions when using PACE, please email PLOS at figures@plos.org. Please note that Supporting Information files do not need this step.

PLoS One. 2023 Mar 31;18(3):e0279076. doi: 10.1371/journal.pone.0279076.r002

Author response to Decision Letter 0


30 Jan 2022

Dear Editor,

The following is a response to the comments from the reviewers.

Reviewer #1:

ResponseI feel I have responded to the reviewers points in the manuscript.

Reviewer #2: *** METHODOLOGY ***

Novel machine learning methods can potentially identify

-> Are any of the ML methods employed truly novel or designed for the purposes of the experiment? If not, remove the word "novel".

Response- The machine learning approaches are have been utilised in other industries (manufacturing, etc.) so are novel (new for this area) for this area. However, I have decided to remove this word to avoid confusion.

In this study, 10% (n=543/5751) of patients were used to develop the model and the remaining patients with a diagnosis between the ages of 15 to 35 years (n=1559/5751, 27% of total) were used to examine the generalizability of the model. This means 63% of the data was not used in

the analysis as these patients were diagnosed with AS before the age of 15 or after the age of 35.

-> The 5751 seems to be from the identified male patients. What about the female? Or am I misunderstanding, and this should be made clearer?

Response- That section does refer to male patients and I have edited the section to try and clarify the intention for clarity as suggested.

This means 63% of the data was not used in the analysis as these patients were diagnosed with AS before the age of 15 or after the age of 35.

-> The majority was not used. NICE was mentioned as the reasoning behind this decision, but you should offer a further discussion as to the benefits vs. detriments of effectively discarding this much data.

Response- Added to document.

Additionally, codes are aggregated so that concepts can be included in the features (e.g. a “pain” code flag may aggregate all the specific pain codes (pain in left thumb and pain in lumbar spine) into one combined “pain present” code

-> Unless I am misunderstanding, how is it beneficial to aggregate all the pain responses into 1 feature? I'd think it would make more sense to have a "pain in AS-associated areas" and "pain in other areas". (I think you actually do this as elaborated later, but then this sentence needs to be better worded.)

Response- Codes existed in their original state and in aggregated states. So, a ‘pain in back’ code would occur on its own and as part of a ‘pain’ code list. Additionally, the pain code list had a overall code list and was split into locations, e.g. a code for pain in lumbar spine would exist on its own, in a overall pain group and in a back pain group. The clinicians wanted to split the pain codes by locations rather than AS specific as male and female [patients can experience different locations of pain.

*** MODEL ***

79300 tests were run for all 793 AS patients and 100 controls each for the male and female cohorts

-> Shouldn't this be 555 (380+175), or were you also using the data set aside for generalizability? If you were, please explain why, because this would seem somewhat problematic.

Response-Your observation is correct. Adjusted in document.

The model selected is the one with the highest average F value across the 100 runs.

-> Why select only 1 model? May there be a benefit to using the previous 100 training models together as a random forest?

Response- It was decided to not employ a random forest approach as the output needed to be as understandable as possible to clinicians and patients to improve trust in the results.

This list of significant variables was then transformed utilising principal component analysis to better understand the structure and relationship of the features to each other.

-> More information on PCA is needed in the manuscript body, e.g. how many principle components were kept after the transform and why was that number selected? Arbitrary?

Response- The principle component were all kept and presented to the model, allowing the best significant variables to be selected.

*** RESULTS AND ANALYSIS ***

Table 1

-> Validation PPV and F-score are very low (0.15% and 0.30% respectively)?

Table 4

-> Validation PPV and F-score are very low (0.25% and 0.50% respectively)?

If we make the assumption that a “perfect” model would have 90% sensitivity and specificity as higher

19 percentages than this would likely be attributed to overfitting of the model.

-> One could counter overfitting e.g. by making better use of a validation set during hyperparameter tuning/optimization. (But this is a small point that you needn't necessarily do anything with, I'm just saying >90% should be achievable without overfitting.)

Response- Thank you for the comment I will keep it in mind for future work.

This implies that the female model is more accurate than the male model at identifying patients with AS.

-> Could it have something to do with the fact more principle components seemed to be used? Please explain.

Response- Added an additional comment.

It must be recognised that with low prevalence of AS in the general population, the positive predictive value in general and primary care clinical settings will always be very low.

-> I don't think this is necessarily true -- a model with extremely high sensitivity and specificity should be able to achieve a relatively high PPV. However, I acknowledge there are some limitations of your specific study -- and perhaps the nature of your model -- that inhibit your model's ability to get a high PPV. Perhaps this can be better clarified in the manuscript body (but it's not detrimental if it cannot).

The results of laboratory tests were not used in this model as they were too complex to interpret in the time available

-> Do you mean the project development time or the 3 years of time before diagnosis or something else? This should be specified.

Response- This refers to the routine data available. Since the project completed, SAIL has got access to lab results from the hospitals in Wales. However, a large amount of work is required to get this data in a suitable format for this kind of analysis.

Thus, 100 Chi-squared tests were run for each of the 3 years preceding the diagnosis date (700 chi-squared tests)

-> You should better explain why 700 tests were required (the reasoning behind the number).

Response- Tidied up in text.

There is some discussion mixed into the results, e.g. "This may imply that there is an increased reluctance to consider a diagnosis of AS or to perform spinal or pelvic x-rays for young female patients compared to their male counterparts" or "suggesting that women have a more complicated path to being diagnosed with AS, with multiple tests, diagnoses, and referrals, compared to men with AS" or "however, women are more likely to be given the test earlier than men. This is likely due to AS symptoms in females being suspected as a result of other conditions, such as RA" or "There was a smaller female cohort for analysis, which could have meant the study was underpowered to detect uveitis as a predictor in women." Please have a separate Discussion section for these and like comments.

*** WHAT YOU NEED YET INCLUDE ***

What software package did you use to implement your models? What were your hardware specs? What's the runtime of the model(s) on the system? What is the filesize of the models?

Response- The dataset was made employing SQL with data in SAIL. The model was run in R studio and had a runtime of < 24 hours for the complete run.

Needs more background and cited works, especially about other machine/deep-learning related AS-diagnostic works regardless of their inputs (e.g. images, features derived from images). Include at least:

-> http://dx.doi.org/10.1186/s42358-020-00126-8

-> https://doi.org/10.1016/j.compmedimag.2020.101718

-> https://doi.org/10.1007/s10067-019-04553-x

Please provide an ROC curve for your models and report AUC. If possible, provide some statistical analysis on the ROC curve (e.g. bootstrapped confidence intervals).

Response- Added to document.

*** POSSIBLE DISCUSSION POINTS ***

This is likely due to the general population cohort having incomplete coverage of data compared to the other cohorts.

-> For generalizability, what is the likelihood that any given patient with back pain has in their record all the utilized data/stats? What could be done about it if they are missing some of the stats?

Response- Many of these individuals were not selected due to failing to meet sufficient criteria for the main analysis. This means that many of these individuals may have incomplete history and relevant information may be missing from there timeline. In future it would be better to perform a validation on data from a different routine data source.

*** POSSIBLE RESEARCH EXPANSION ***

What about taking only the most common stats (that would be in the record of most patients) and possibly a shorter history time frame and re-running the experiment? How might results differ? It would be interesting to see and possibly include, but if you feel it is too out of scope consider it for future work.

Response- Having a shorter minimum history would increase the population size.

*** GRAMMAR AND WORD CHOICE ***

AS is an important inflammatory musculoskeletal condition with effective therapy available,

especially if identified early

-> Word choice: "important"? Important how so? A better word could be used here to convey the meeting you want, which admittedly was somewhat vague to me.

Response- The word “important” has been removed to avoid confusion.

especially for women with AS who have not well studied or recognised.

-> Grammar and meaning: "especially for women with AS, who traditionally have had later diagnoses possibly due to other factors; this area requires further research."

Response- Changed in document.

an unspecific back pain code present between age 15 and 20 AND a pelvic pain codes present between age 25 and 30.

-> Grammar: between ages X and Y (also elsewhere); a pelvic pain code or pelvic pain codes.

Response- Changed in document.

who hasan ESR test

-> Grammar: has an

Response- The word “hasan” has been changed to “has an”.

The model was the applied to the unused individuals

-> Grammar: The model was applied to...

Response- Changed in document.

*** OTHER ***

Maybe combine the supplementary figures and write XXX individuals as XXX/YYY individuals, explaining that XXX denotes male and YYY denotes female.

Response- I think that even though this would make the supplementary figures more streamlined, it might make the figures more confusing to read.

The next stage would be to take the profiles of the decision trees forward so that we can identify people who fit the profile but are not diagnosed, and seek additional data about these patients from both medical records (e.g. results of laboratory tests such as elevated CRP) and to incorporate information directly from patients via an online patient reported measures questionnaire to capture more granularity and current symptoms (e.g. duration of pain, stiffness and pain worse in morning, pain improved with movement, buttock pain, hot burning joints, family history of SpA)

-> Sounds reasonable!

In the discussion, I really liked how you characterized the male and female "warning signs" and proposed actionable steps toward diagnosis in clinical practice.

I enjoyed reading the article and hope you use my suggestions to make it the best it can be! Have a good day.

Response- Thank you very much for your comments and suggestions. I feel they have made the document more clear.

Yours Faithfully,

Dr Jonathan Ian Kennedy.

Attachment

Submitted filename: Response to Reviewers.docx

Decision Letter 1

Alfredo Vellido

28 Feb 2022

PONE-D-20-36921R1Predicting a diagnosis of ankylosing spondylitis using primary care health records – a machine learning approach.PLOS ONE

Dear Dr. Kennedy,

Thank you for submitting your manuscript to PLOS ONE. After careful consideration, we feel that it has merit but does not fully meet PLOS ONE’s publication criteria as it currently stands. Therefore, we invite you to submit a revised version of the manuscript that addresses the points raised during the review process.

Please submit your revised manuscript by Apr 14 2022 11:59PM. If you will need more time than this to complete your revisions, please reply to this message or contact the journal office at plosone@plos.org. When you're ready to submit your revision, log on to https://www.editorialmanager.com/pone/ and select the 'Submissions Needing Revision' folder to locate your manuscript file.

Please include the following items when submitting your revised manuscript:

  • A rebuttal letter that responds to each point raised by the academic editor and reviewer(s). You should upload this letter as a separate file labeled 'Response to Reviewers'.

  • A marked-up copy of your manuscript that highlights changes made to the original version. You should upload this as a separate file labeled 'Revised Manuscript with Track Changes'.

  • An unmarked version of your revised paper without tracked changes. You should upload this as a separate file labeled 'Manuscript'.

If you would like to make changes to your financial disclosure, please include your updated statement in your cover letter. Guidelines for resubmitting your figure files are available below the reviewer comments at the end of this letter.

If applicable, we recommend that you deposit your laboratory protocols in protocols.io to enhance the reproducibility of your results. Protocols.io assigns your protocol its own identifier (DOI) so that it can be cited independently in the future. For instructions see: https://journals.plos.org/plosone/s/submission-guidelines#loc-laboratory-protocols. Additionally, PLOS ONE offers an option for publishing peer-reviewed Lab Protocol articles, which describe protocols hosted on protocols.io. Read more information on sharing protocols at https://plos.org/protocols?utm_medium=editorial-email&utm_source=authorletters&utm_campaign=protocols.

We look forward to receiving your revised manuscript.

Kind regards,

Alfredo Vellido

Academic Editor

PLOS ONE

Journal Requirements:

Please review your reference list to ensure that it is complete and correct. If you have cited papers that have been retracted, please include the rationale for doing so in the manuscript text, or remove these references and replace them with relevant current references. Any changes to the reference list should be mentioned in the rebuttal letter that accompanies your revised manuscript. If you need to cite a retracted article, indicate the article’s retracted status in the References list and also include a citation and full reference for the retraction notice.

Additional Editor Comments (if provided):

Dear authors,

The revised version of your paper has improved on the original one, but you still need to provide a response to the fair further requests from reviewer #2.

[Note: HTML markup is below. Please do not edit.]

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Author

1. If the authors have adequately addressed your comments raised in a previous round of review and you feel that this manuscript is now acceptable for publication, you may indicate that here to bypass the “Comments to the Author” section, enter your conflict of interest statement in the “Confidential to Editor” section, and submit your "Accept" recommendation.

Reviewer #2: (No Response)

**********

2. Is the manuscript technically sound, and do the data support the conclusions?

The manuscript must describe a technically sound piece of scientific research with data that supports the conclusions. Experiments must have been conducted rigorously, with appropriate controls, replication, and sample sizes. The conclusions must be drawn appropriately based on the data presented.

Reviewer #2: Yes

**********

3. Has the statistical analysis been performed appropriately and rigorously?

Reviewer #2: No

**********

4. Have the authors made all data underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data—e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #2: Yes

**********

5. Is the manuscript presented in an intelligible fashion and written in standard English?

PLOS ONE does not copyedit accepted manuscripts, so the language in submitted articles must be clear, correct, and unambiguous. Any typographical or grammatical errors should be corrected at revision, so please note any specific errors here.

Reviewer #2: Yes

**********

6. Review Comments to the Author

Please use the space provided to explain your answers to the questions above. You may also include additional comments for the author, including concerns about dual publication, research ethics, or publication ethics. (Please upload your review as an attachment if it exceeds 20,000 characters)

Reviewer #2: I've looked through the changes and the manuscript has certainly been improved. I can agree with most of the authors' modifications and/or refutations of my suggestions. Nevertheless, there are still a few things I would like clarified or included:

1. I still do not think it is clear why the Validation PPV and F-score are very low, compared to the train and test sets, in Tables 1 and 4. A more detailed description of how you used the validation set (e.g. vs the test set during model development/evaluation) may help.

2. Thanks for the information on model runtime (<24 hours) and development platform (R Studio). Please include these in the manuscript body. Furthermore, please include the system hardware specifications, and try to give a (more) specific runtime for the complete prediction/processing of 1 patient record through the model.

3. I would like to see in the manuscript a (bootstrapped) ROC curve over the final test data; please make and provide one. Since you are using R, the pROC package may be useful (https://www.rdocumentation.org/packages/pROC/versions/1.18.0). I have provided some sample (psuedo)code below to assist with this, where IN_DATA_TRUE and IN_DATA_PREDICT are vectors containing binary class info (e.g. 1 for AS and 0 for non-AS).

4. "This implies that the female model is more accurate than the male model at identifying patients with AS." -> In partial regard to this, you stated, "The principle component were all kept and presented to the model, allowing the best significant variables to be selected," which is a fair response. Could you provide some brief commentary on why you think the feature engineering process created more principle components for females than males, and to what degree (you believe) the number of components has on the final model accuracy?

Thanks for submitting your revised article, it was nice to read and exciting to see how it has progressed!

--- Sample pROC Code ---

library(pROC)

roc_obj <- roc(IN_DATA_TRUE, IN_DATA_PREDICT)

auc <- auc(roc_obj)

aucci <- ci.auc(roc_obj, boot.n=10000) # get 95% confidence interval

thresh <- ci.thresholds(roc_obj, boot.n=10000)

plot.new()

plot.roc(roc_obj, xlab="FPR", ylab="TPR", legacy=TRUE)

plot(thresh)

dev.off()

**********

7. PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #2: No

[NOTE: If reviewer comments were submitted as an attachment file, they will be attached to this email and accessible via the submission site. Please log into your account, locate the manuscript record, and check for the action link "View Attachments". If this link does not appear, there are no attachment files.]

While revising your submission, please upload your figure files to the Preflight Analysis and Conversion Engine (PACE) digital diagnostic tool, https://pacev2.apexcovantage.com/. PACE helps ensure that figures meet PLOS requirements. To use PACE, you must first register as a user. Registration is free. Then, login and navigate to the UPLOAD tab, where you will find detailed instructions on how to use the tool. If you encounter any issues or have any questions when using PACE, please email PLOS at figures@plos.org. Please note that Supporting Information files do not need this step.

PLoS One. 2023 Mar 31;18(3):e0279076. doi: 10.1371/journal.pone.0279076.r004

Author response to Decision Letter 1


21 Jun 2022

Thank you very much Reviewer 2 for recognising the improvements made between the two versions of this paper, we really appreciate it. Thank you for your further suggestions, we have endeavoured to make the changes or explanations required.

1. I still do not think it is clear why the Validation PPV and F-score are very low, compared to the train and test sets, in Tables 1 and 4. A more detailed description of how you used the validation set (e.g. vs the test set during model development/evaluation) may help.

The lower values observed in the validation dataset, in comparison to the training/testing datasets, can be explained in the following ways.

• The validation dataset includes records that were deemed not suitable for the main analysis, so those records might not have suitable data coverage and be of lower quality, resulting in incorrect classification.

• The models were developed on a 1:1 (case to control) basis and when presented with a less favourable ratio it became harder to achieve good PPV values as there is a much higher ratio of not cases in the general population compared to the training dataset. This is likely why many other models do not work well in the real world. However, the authors feel that the approach undertaken achieved some good hypotheses and results which can better aid the identification of AS.

2. Thanks for the information on model runtime (<24 hours) and development platform (R Studio). Please include these in the manuscript body. Furthermore, please include the system hardware specifications, and try to give a (more) specific runtime for the complete prediction/processing of 1 patient record through the model.

Thank you for this feedback, the following section has been added to the paper (Materials and methods section: Dataset).

The dataset construction and analysis were undertaken in Eclipse and R Studio in the SAIL remote desktop server; the processor employed was an AMD EPYC 7543 32-Core Processor 2.79 GHz (2 processors) with 16.0 GB of RAM and running Windows 10. The run time for construction of the dataset and running the analysis was < 24 hours, with most of the time expended generating the dataset for the analysis to be undertaken. The processing of one patient took 32 seconds, with much of the time taken in R studio communicating with the SQL server.

3. I would like to see in the manuscript a (bootstrapped) ROC curve over the final test data; please make and provide one. Since you are using R, the pROC package may be useful (https://www.rdocumentation.org/packages/pROC/versions/1.18.0). I have provided some sample (psuedo)code below to assist with this, where IN_DATA_TRUE and IN_DATA_PREDICT are vectors containing binary class info (e.g. 1 for AS and 0 for non-AS).

This section requires graphs to answer which are included in the attachment.

4. "This implies that the female model is more accurate than the male model at identifying patients with AS." -> In partial regard to this, you stated, "The principle component were all kept and presented to the model, allowing the best significant variables to be selected," which is a fair response. Could you provide some brief commentary on why you think the feature engineering process created more principle components for females than males, and to what degree (you believe) the number of components has on the final model accuracy?

There are more cases of AS present in males than females. AS usually develops in young adults, and male/female have a different healthcare usage at this age. Young men tend to have a much lower usage than females so will likely have a simpler profile in their healthcare record than females. An additional reason might be that the symptoms expressed in a male would be identified as AS quicker, compared to females who might investigate other conditions before AS (e.g. RA, etc.).

Attachment

Submitted filename: Response to Reviewers 2.docx

Decision Letter 2

Alfredo Vellido

3 Aug 2022

PONE-D-20-36921R2

Predicting a diagnosis of ankylosing spondylitis using primary care health records – a machine learning approach.

PLOS ONE

Dear Dr. Kennedy,

Thank you for submitting your manuscript to PLOS ONE. After careful consideration, we feel that it has merit but does not fully meet PLOS ONE’s publication criteria as it currently stands. Therefore, we invite you to submit a revised version of the manuscript that addresses the points raised during the review process.

Please submit your revised manuscript by Sep 17 2022 11:59PM. If you will need more time than this to complete your revisions, please reply to this message or contact the journal office at plosone@plos.org. When you're ready to submit your revision, log on to https://www.editorialmanager.com/pone/ and select the 'Submissions Needing Revision' folder to locate your manuscript file.

Please include the following items when submitting your revised manuscript:

  • A rebuttal letter that responds to each point raised by the academic editor and reviewer(s). You should upload this letter as a separate file labeled 'Response to Reviewers'.

  • A marked-up copy of your manuscript that highlights changes made to the original version. You should upload this as a separate file labeled 'Revised Manuscript with Track Changes'.

  • An unmarked version of your revised paper without tracked changes. You should upload this as a separate file labeled 'Manuscript'.

If you would like to make changes to your financial disclosure, please include your updated statement in your cover letter. Guidelines for resubmitting your figure files are available below the reviewer comments at the end of this letter.

If applicable, we recommend that you deposit your laboratory protocols in protocols.io to enhance the reproducibility of your results. Protocols.io assigns your protocol its own identifier (DOI) so that it can be cited independently in the future. For instructions see: https://journals.plos.org/plosone/s/submission-guidelines#loc-laboratory-protocols. Additionally, PLOS ONE offers an option for publishing peer-reviewed Lab Protocol articles, which describe protocols hosted on protocols.io. Read more information on sharing protocols at https://plos.org/protocols?utm_medium=editorial-email&utm_source=authorletters&utm_campaign=protocols.

We look forward to receiving your revised manuscript.

Kind regards,

Alfredo Vellido

Academic Editor

PLOS ONE

Journal Requirements:

Please review your reference list to ensure that it is complete and correct. If you have cited papers that have been retracted, please include the rationale for doing so in the manuscript text, or remove these references and replace them with relevant current references. Any changes to the reference list should be mentioned in the rebuttal letter that accompanies your revised manuscript. If you need to cite a retracted article, indicate the article’s retracted status in the References list and also include a citation and full reference for the retraction notice.

[Note: HTML markup is below. Please do not edit.]

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Author

1. If the authors have adequately addressed your comments raised in a previous round of review and you feel that this manuscript is now acceptable for publication, you may indicate that here to bypass the “Comments to the Author” section, enter your conflict of interest statement in the “Confidential to Editor” section, and submit your "Accept" recommendation.

Reviewer #2: (No Response)

********** 

2. Is the manuscript technically sound, and do the data support the conclusions?

The manuscript must describe a technically sound piece of scientific research with data that supports the conclusions. Experiments must have been conducted rigorously, with appropriate controls, replication, and sample sizes. The conclusions must be drawn appropriately based on the data presented.

Reviewer #2: Yes

********** 

3. Has the statistical analysis been performed appropriately and rigorously?

Reviewer #2: Yes

********** 

4. Have the authors made all data underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data—e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #2: Yes

********** 

5. Is the manuscript presented in an intelligible fashion and written in standard English?

PLOS ONE does not copyedit accepted manuscripts, so the language in submitted articles must be clear, correct, and unambiguous. Any typographical or grammatical errors should be corrected at revision, so please note any specific errors here.

Reviewer #2: Yes

********** 

6. Review Comments to the Author

Please use the space provided to explain your answers to the questions above. You may also include additional comments for the author, including concerns about dual publication, research ethics, or publication ethics. (Please upload your review as an attachment if it exceeds 20,000 characters)

Reviewer #2: All of my questions have been answered satisfactorily. Thank you very much!

The ROC curve and the corresponding ROC AUC must be reported in the manuscript body as part of the results. Furthermore, I believe the explanation about the validation set and the rationale for why there are more principle components for females should be incorporated into the manuscript as part of a discussion; this would make the manuscript stronger and give readers a better understanding of the results and implications.

Thereafter, this manuscript should be fit for publication.

********** 

7. PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #2: No

**********

[NOTE: If reviewer comments were submitted as an attachment file, they will be attached to this email and accessible via the submission site. Please log into your account, locate the manuscript record, and check for the action link "View Attachments". If this link does not appear, there are no attachment files.]

While revising your submission, please upload your figure files to the Preflight Analysis and Conversion Engine (PACE) digital diagnostic tool, https://pacev2.apexcovantage.com/. PACE helps ensure that figures meet PLOS requirements. To use PACE, you must first register as a user. Registration is free. Then, login and navigate to the UPLOAD tab, where you will find detailed instructions on how to use the tool. If you encounter any issues or have any questions when using PACE, please email PLOS at figures@plos.org. Please note that Supporting Information files do not need this step.

PLoS One. 2023 Mar 31;18(3):e0279076. doi: 10.1371/journal.pone.0279076.r006

Author response to Decision Letter 2


10 Oct 2022

Response to Reviewers

The ROC curves have been incorporated into the results section. The discussion section has been expanded to discuss why the male and female cohorts generate different amounts of principle components, as suggested by the reviewers.

The authors would like to thank that comment submitted by the reviewers for recognising the improvements made between the versions of this paper, we really appreciate it. Thank you for your further suggestions, we have endeavoured to make the changes or explanations required.

Attachment

Submitted filename: Response to Reviewers 20221010.docx

Decision Letter 3

Alfredo Vellido

1 Dec 2022

Predicting a diagnosis of ankylosing spondylitis using primary care health records – a machine learning approach.

PONE-D-20-36921R3

Dear Dr. Kennedy,

We’re pleased to inform you that your manuscript has been judged scientifically suitable for publication and will be formally accepted for publication once it meets all outstanding technical requirements.

Within one week, you’ll receive an e-mail detailing the required amendments. When these have been addressed, you’ll receive a formal acceptance letter and your manuscript will be scheduled for publication.

An invoice for payment will follow shortly after the formal acceptance. To ensure an efficient process, please log into Editorial Manager at http://www.editorialmanager.com/pone/, click the 'Update My Information' link at the top of the page, and double check that your user information is up-to-date. If you have any billing related questions, please contact our Author Billing department directly at authorbilling@plos.org.

If your institution or institutions have a press office, please notify them about your upcoming paper to help maximize its impact. If they’ll be preparing press materials, please inform our press team as soon as possible -- no later than 48 hours after receiving the formal acceptance. Your manuscript will remain under strict press embargo until 2 pm Eastern Time on the date of publication. For more information, please contact onepress@plos.org.

Kind regards,

Alfredo Vellido

Academic Editor

PLOS ONE

Additional Editor Comments (optional):

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Author

1. If the authors have adequately addressed your comments raised in a previous round of review and you feel that this manuscript is now acceptable for publication, you may indicate that here to bypass the “Comments to the Author” section, enter your conflict of interest statement in the “Confidential to Editor” section, and submit your "Accept" recommendation.

Reviewer #2: All comments have been addressed

**********

2. Is the manuscript technically sound, and do the data support the conclusions?

The manuscript must describe a technically sound piece of scientific research with data that supports the conclusions. Experiments must have been conducted rigorously, with appropriate controls, replication, and sample sizes. The conclusions must be drawn appropriately based on the data presented.

Reviewer #2: Yes

**********

3. Has the statistical analysis been performed appropriately and rigorously?

Reviewer #2: Yes

**********

4. Have the authors made all data underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data—e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #2: Yes

**********

5. Is the manuscript presented in an intelligible fashion and written in standard English?

PLOS ONE does not copyedit accepted manuscripts, so the language in submitted articles must be clear, correct, and unambiguous. Any typographical or grammatical errors should be corrected at revision, so please note any specific errors here.

Reviewer #2: Yes

**********

6. Review Comments to the Author

Please use the space provided to explain your answers to the questions above. You may also include additional comments for the author, including concerns about dual publication, research ethics, or publication ethics. (Please upload your review as an attachment if it exceeds 20,000 characters)

Reviewer #2: I reviewed the part of the document containing the revision markings (pages 69 to 97 of the full PDF) and my concerns have all largely been addressed. I would just advise a proofread before publication (e.g. "an approach" rather than "a approach" where the original read "a new approach"). Additionally, "Limitations" should probably be its own (sub)section, rather than just "Limitations:" at the start of a paragraph.

Congratulations! I hope you all have a nice celebration and enjoy a well-deserved drink. :)

**********

7. PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #2: No

**********

Acceptance letter

Alfredo Vellido

24 Mar 2023

PONE-D-20-36921R3

Predicting a diagnosis of ankylosing spondylitis using primary care health records – a machine learning approach.

Dear Dr. Kennedy:

I'm pleased to inform you that your manuscript has been deemed suitable for publication in PLOS ONE. Congratulations! Your manuscript is now with our production department.

If your institution or institutions have a press office, please let them know about your upcoming paper now to help maximize its impact. If they'll be preparing press materials, please inform our press team within the next 48 hours. Your manuscript will remain under strict press embargo until 2 pm Eastern Time on the date of publication. For more information please contact onepress@plos.org.

If we can help with anything else, please email us at plosone@plos.org.

Thank you for submitting your work to PLOS ONE and supporting open access.

Kind regards,

PLOS ONE Editorial Office Staff

on behalf of

Dr. Alfredo Vellido

Academic Editor

PLOS ONE

Associated Data

    This section collects any data citations, data availability statements, or supplementary materials included in this article.

    Supplementary Materials

    S1 Fig. Male participants with AS.

    (TIFF)

    S2 Fig. Female participants with AS.

    (TIFF)

    S1 Table. Principal component analysis results for males.

    (DOCX)

    S2 Table. Principal component analysis results for females.

    (DOCX)

    S3 Table. Code identified in both male and female analysis, male only or female only.

    (DOCX)

    Attachment

    Submitted filename: Response to Reviewers.docx

    Attachment

    Submitted filename: Response to Reviewers 2.docx

    Attachment

    Submitted filename: Response to Reviewers 20221010.docx

    Data Availability Statement

    The data is owned by the SAIL Databank (https://saildatabank.com/) and all datasets are available from them upon request and appropriate information governance. The authors had no special access privileges to the data others would not have.


    Articles from PLOS ONE are provided here courtesy of PLOS

    RESOURCES