1 Introduction

Anxiety disorders are associated with significant disability and they are the most prevalent of the psychiatric disorders, typically have an early onset and chronic course, and are associated with significant co morbidity (Stein et al. 2009).

Social anxiety disorder (SAD), also known as social phobia, is the most common anxiety disorder, with lifetime prevalence estimates as high as 12 % (Kessler et al. 2005). SAD refers to persistent fears of situations involving social interaction or social performance or situations in which there is the potential for scrutiny by others (American Psychiatric Association 1994) causing considerable distress and impaired ability to function in at least some parts of daily life.

It is common for sufferers of social phobia to self-medicate, especially if they are undiagnosed, untreated, or both. This can lead to alcoholism, eating disorders or other kinds of substance abuse. An early diagnosis may help in minimizing the symptoms and the development of additional problems, such as depression.

Diagnosis is the first step from a set of therapeutic actions that are developed in order to save the patients’ life or to improve their health. Nowadays physicians can use a lot of systems and mathematical methods that can be applied to suggest a diagnosis or to give a prognosis about the health level of a patient (Curiac et al. 2009; Oskooyee et al. 2011).

Bayesian networks (BNs) have become increasingly popular for handling the uncertain knowledge involved in establishing diagnoses of disease and are also used in clinical epidemiology for the construction of disease models (Lucas et al. 2004).

In this paper, Bayesian networks are involved in a psychiatric decision making process for predicting the probability of a patient suffering from SAD based on detected causes and symptoms include some cognitive-behavioral factors.

The remainder of this paper is organized as follows. Social anxiety disorder is described in Sect. 2. Section 3 offers a background knowledge concerning Bayesian networks. The steps in formalizing and constructing the Bayesian network structure and conditional probability tables (CPTs) for social anxiety is described in Sect. 4, and Sect. 5 presents evaluation and experimental results of the model. Finally, conclusions and recommendations for future work are summarized in Sect. 6.

2 Social anxiety disorder

There are many types of anxiety disorders including social anxiety disorder, generalized anxiety disorder, specific phobias, panic disorder, etc. An anxiety disorder is a serious mental illness. For people with anxiety disorders, worry and fear are constant and overwhelming, and can be crippling. Anxiety disorders can cause such distress that they interfere with a person’s ability to lead a normal life.

Doctors often do not diagnose anxiety disorder straight away. Many patients end up seeing several doctors, over many months or years, before they find out they have anxiety disorder and start having treatment. Some of the symptoms of anxiety disorder are similar to the symptoms of other mental health problems, such as depression or panic attacks. Therefore a doctor may think a patient has one of these other disorders. And many people with anxiety disorder also have other mental health disorders, so a doctor may diagnose another problem without realizing that the patient also has anxiety disorder. A doctor may think that the physical symptoms are a sign of heart disease or another physical illness. For these reasons, anxiety disorders can be hard to spot.

Social anxiety disorder is the main focus of considerable researches in mental health, due to its prevalence and costs. The lifetime prevalence of SAD was 7–13 % in western countries (Furmark 2002). SAD involves overwhelming worry and self-consciousness about everyday social situations. The worry often centers on a fear of being judged by others, or behaving in a way that might cause embarrassment or lead to ridicule. This disorder often occurs alongside low self-esteem and major depressive disorder, due to lack of personal relationships and long periods of isolation from avoiding social situations. To try to reduce their anxiety and alleviate depression, people with social phobia may use alcohol or other drugs, which can lead to substance abuse. As a report from NIAAA of the National Institutes of Health, it is estimated that one-fifth of patients with social anxiety disorder also suffer from alcohol dependence. The most common social phobia is fear of public speaking or performing in front of an audience. Other situations that commonly trigger social anxiety include taking exams, being the center of attention, eating or drinking in public, dating, going to a party, using public bathrooms, etc.

Most of individuals with SAD (72–87 %) do not seek treatment (Magee et al. 1996). It is considered symptoms of shame and social avoidance in SAD related to a sense of stigma (Berman and Schneier 2004). Therefore, they avoid to disclose their fears (Starcevic 2005).

As part of the diagnostic process, a doctor or mental health professional may have the patient complete one or more screening questionnaires to assess the presence of SAD symptoms. Although screening questionnaires cannot on their own be used to obtain a diagnosis, the results of these questionnaires will provide a clear picture as to whether further assessment is needed. SAD is an anxiety disorder with varying degrees of severity. It can be considered as a continuum. Standardized rating scales such as Social Phobia Inventory (SPIN) (Connor et al. 2000) can be used for screening SAD and measuring severity of it.

3 Bayesian networks

Bayesian networks were introduced in the 1980s as a formalism for representing and reasoning with problems involving uncertainty, adopting probability theory as a basic framework (Lucas 1999).

3.1 The formalism

A Bayesian network is a model. It reflects the states of some part of a world that is being modeled and it describes how those states are related by probabilities. Anything can be modeled, for example a Bayesian network could represent the probabilistic relationships between diseases and symptoms (Fallahi and Jafari 2011).

A Bayesian Network is a binary group, namely S = <G,P>, in which:

  1. 1.

    G is a directed acyclic graph (DAG). The nodes correspond to random variables and the directed arcs represent probabilistic dependence between variables. The meaning of the arc from x to y is that x has a direct influence on y.

  2. 2.

    P is the set of local probability distribution, P = P {P (x | π x )} is conditional probability, which is used to measure the strength of casual dependencies and π x is the set of parent nodes of x (Yu et al. 2009).

Hence the joint probability over x is equal to the product of conditional probability table of all the variables:

$$P \, \left( {x_{1} , \, x_{2} , \ldots ,x_{n} } \right) \, = \mathop \prod \limits_{i = 1}^{n} P (xi|\pi i)$$

in which, n is the number of nodes in Bayesian network.

Mathematically, Bayes’ theorem gives the relationship between the probabilities of A and B P(A) and P(B), and the conditional probabilities of A given B and B given A, P(A|B) and P(B|A). In its most common form, it is:

$$P\left( {A|B} \right) = \frac{{P\left( {B|A} \right)P(A)}}{P(B)}$$

In the Bayesian (or epistemological) interpretation, probability measures a degree of belief. Bayes’ theorem then links the degree of belief in a proposition before and after accounting for evidence.

For proposition A and evidence B,

  • P(A), the prior, is the initial degree of belief in A.

  • The prior, is the initial degree of belief in A.

  • P(A|B), the posterior, is the degree of belief having been accounted for B.

  • P(B|A)/P(B) represents the support B provides for A.

The result of modeling by Bayesian network is an enormous saving of computation, since a Bayesian network only relates nodes that are probabilistically related by some sort of casual dependency. All that is needed to store and work with is all possible combinations of states between sets of related parent and child nodes. Thus this can result a great saving of table space and computation.

Another reason of why we choose Bayesian network for our modeling is that it is so adaptable. It can be started off small, with limited knowledge about a domain, and be grown as new knowledge is acquired. This is another powerful feature of Bayesian nets. They are easily extended (or reduced, simplified) to suit changing needs and knowledge.

It has been proved that Bayesian network is useful in practical applications, such as medical diagnosis and diagnostic systems (Olmus 2004).

3.2 Bayesian networks in medical diagnosis

Bayesian networks are directed acyclic graphs modeling probabilistic dependencies and independencies among variables. The graphical part of them reflects the structure of a problem while local interactions among neighboring variables are quantified by conditional probability distributions (Oniśko et al. 2001). The nodes and arcs of a BN model represent, respectively, the random variables and the dependencies among the variables. The direction of the arcs represents the relations of consequence–cause among the variables. In a BN model, a parent node is a cause of a child node (Pinheiro et al. 2008). BNs are also known as belief networks, causal probabilistic networks, causal nets, graphical probability networks, and probabilistic influence diagrams (Olmus 2004).

As an example of a simple model of disease diagnosis, a two-layer model of disease diagnosis is used in (Yu et al. 2009), in which there are two types of nodes in the disease diagnosis system. The upper layer is composed of disease nodes and the lower layer is composed of symptom nodes and the arc direction is from disease nodes to symptom nodes.

In the domain of psychiatric disease diagnosis, it is used from Bayesian networks in assist to the diagnosis of dementia and Alzheimer (Triviño et al. 2011; Castro et al. 2009; Pinheiro et al. 2008). Also, a Bayesian network model for diagnosis of schizophrenia and mixed dementia is developed (Curiac et al. 2009).

In the domain of anxiety disorders diagnosis, in (Estabragh et al. 2011), a Bayesian network model for diagnosis of SAD based on physical symptoms is constructed.

BNs have become increasingly popular for handling the uncertain knowledge involved in establishing diagnosis of disease, in selecting optimal treatment alternatives, and predicting the treatment outcome. They are also used in building decision-support systems for individual patient care (Lucas et al. 2004). However, the main efficiency of medical Bayesian networks remains in the diagnosis field (Curiac et al. 2009).

4 The Bayesian network modeling of social anxiety

The main focus of this work is to develop a BN model for analyzing SAD, based on some cognitive-behavioral predictors, observed symptoms and a priori known causal relationships, with the precise objective of helping physicians and mental health professionals in their decisional process. Whereas Bayesian network has two parts, the process of BN construction is to construct structure and conditional probability tables.

4.1 The Bayesian network construction

There are three methods to construct Bayesian networks: manual construction, learning and a combination of them (Yu et al. 2009). In this work, we construct the structure of our BN model manually using domain knowledge and interviews with experts. In this process, variables and relationships between them should be determined. The first stage in manual construction is the identification of the important variables generally based on interviews with experts and descriptions of the domain. It is important to limit variables and choose important variables which are target variables and observation (evidence) variables. Target variables are outputs of network and what we want to know and observation variables are inputs of network (Yu et al. 2009). After that, the dependence and independence relationships among the variables have to be analyzed and expressed in the graphical structure (Lucas et al. 2004).

After the modeling stage, the Bayesian inference is used to update the network statistical knowledge based on current observations and the Bayes theorem (Curiac et al. 2009). Inference in a BN means computing the conditional probabilities for some variables, given evidence concerning other variables. Evidence is produced by responses to clinical questions (tests, signs or symptoms) (Olmus 2004).

The BN graphical model is presented in Fig. 1. Analyzing the structure presented in Fig. 1, we can observe a number of nodes having a significant influence inside the network. We describe them below.

Fig. 1
figure 1

The Bayesian network graphical model of social anxiety

There has been a continuing controversy between categorical and dimensional approach to social anxiety disorder. Researchers with the dimensional approach consider social anxiety as a continuum; in line with this view, Rapee and Spence’s (2004) model is one of the models that are based on the dimensional approach to social anxiety. Rapee and Spence (2004) introduced some general factors in their model that contribute to the development of social anxiety disorder. According to this model and literature, we chose some factors.

Shyness (X4 node) is one of the important genetic factors in the field of social anxiety disorder. The definitions of shyness and social anxiety disorder in somatic, cognitive and behavioral symptoms are alike (Heiser et al. 2009). In this research, Stanford Shyness Survey (Zimbardo 1977) was used for screening shyness and measuring severity of it.

Another related temperament to SAD is behavioral inhibition (BI), which refers to a child response to novel stimulus by behavioral withdrawal, timidity, increased vigilance and excessive arousal (Kagan et al. 1988). Some evidence indicate that BI contributes to development of anxiety disorders (Perez-Edgar and Fox 2005) especially social anxiety disorder (e.g., Coplan et al. 2006; van Brakel et al. 2006). For measuring the two variables of childhood behavioral inhibition (X1 node) and adulthood behavioral inhibition (X2 node) respectively, Retrospective Measure of Behavioral Inhibition and Adult Measure of Behavioral Inhibition (Gladstone and Parker 2005) were used.

To consider the interpersonal deficits in SAD, attachment theory can be useful (Eng et al. 2001). This theory suggests that the experiences with earlier significant others can be generalized to future interpersonal functioning. In this regard, Michelson et al. (1997) found that social anxiety disorder was positively related to avoidant and anxious styles. Furthermore, for measuring the two variables of anxious attachment style (X5 node) and avoidant attachment style (X6 node), the Adult Attachment scale questionnaire (AAS; Collins and Read 1990) was used.

Cognitive-behavioral models (e.g., Rapee and Heimberg 1997; Clark and Wells 1995) emphasized the dysfunctional cognitive processes in the maintenance of SAD (Hofmann 2007). Social anxious people showed different kinds of bias in information processing such as interpretation bias. Individuals with social anxiety disorder misinterpret the ambiguous social situations (Heinrichs and Hofmann 2001). Interpretation bias has various components like negative self-evaluation (X8 node) and perceived negative evaluation by others (X9 node) (Heimberg and Becker 2002). For measuring these two variables, the Consequences of Negative Social Events Questionnaire (CONSE-Q) (Wilson and Rapee 2005) was used.

Self-efficacy refers to “the conviction that one can successfully execute the behavior required to produce the outcomes” (Bandura 1977). High socially anxious individuals are likely to devalue their social performance; they succeed objectively though (e.g., Clark and Wells 1995). In this regard, Gaudiano and Herbert (2006) noted that self-efficacy might be especially important for understanding the SAD and it has a moderately inverse correlation with social anxiety. For the measurement of the variable of social self-efficacy (X13 node), the social situation scale questionnaire (SESS; Gaudiano and Herbert 2003) was used.

Thus, in the current research, we assumed shyness and behavioral inhibition (childhood and adulthood) as genetic factors and attachment (secure, avoidant and anxious) as parent influence. Social self-efficacy stemmed from poor social skills construct and interpretation bias (negative self-evaluation and perceived negative evaluation by others) arose from interrupted social performance construct.

In general, the symptoms of SAD reflect a fear of being embarrassed or humiliated in front of others. According to Rapee and Heimberg’ (1997) model, anxiety can be seen in behavioral, cognitive and physical symptoms in socially anxious people. Therefore, the physical symptoms reported by many persons with social phobia include sweating, trembling, blushing, palpitations, nausea, twitching, shaky voice and dry mouth (X11 node) (Brunello et al. 2000). In this research, for collection data, Behavioral symptoms of Anxiety (X12 node) were also rated by asking a number of questions. To consider mentioned symptoms, social anxiety disorder is associated with some impairment in social function (Eng et al. 2005) and significant interference to different domains of life especially in the career, academic and interpersonal functioning (X10 node) (Hofmann and Barlow 2002).

For the three aforementioned variables, a number of questions were designed in the form of a questionnaire and they were rated so that their value is determined using the sum of the scores.

In sum, in each questionnaire, the range of variation of the total scores was different and we classified this range for each variable into three groups: mild, moderate, and severe. In fact, all continuous variables except ‘social anxiety’ were discretized into three relatively equal-width intervals.

In Fig. 1, we have the qualitative representation of the Bayesian network. We need to specify the quantitative representation of our Bayesian network that is the set of conditional probability tables of the nodes.

There are several commercial and research tools designed for BN model authoring and testing. Among the most popular of these tools are Hugin, Netica, and GeNIe. We used Netica software from Norsys (Netica, www.norsys.com) for the construction of the Bayesian network, because of its simplicity and high performance. Netica allows network construction and parameter learning from data. Parameter learning determines the conditional probability table at each node. According to data, we can achieve prior and conditional probabilities. In order to learn the CPTs, data were gathered from a number of university students.

4.2 Data collection for learning and testing the model

The statistical population consisted of the students of a university, from which a sample from the five educational groups of human sciences, technical sciences, medical sciences, basic sciences and arts was selected randomly and in multiple stages. Three faculties from each group and a number of students from each faculty were randomly selected. The questionnaires were given to the volunteers in each faculty. In sum, 438 students of a university (218 male and 220 female) participated in this study (first phase). All participants completed Social Phobia Inventory, Stanford Shyness Survey, Adult Measure of Behavioral Inhibition, Retrospective Measure of Behavioral Inhibition, Consequences of Negative Social Events Questionnaire, Self-efficacy for Social Situation Scale and Adult Attachment Scale. After data collection, the average age of the participants was 21.37 ± 2.43.

In the next phase, whereas the total score higher than 19 in Social Phobia Inventory indicates on likelihood of social anxiety disorder, some students with the total score of over 19 were invited to participate in the diagnostic interview. Consistent with the nature of SAD that discussed or some other reasons that were not identified in the current research, some of these students refused to participate in the interview. After interviewing with Structured Clinical Interview for DSM-IV Axis I Disorders (SCID-I) (First et al. 1994), 22 of the participants were certainly diagnosed with SAD. Among these individuals, the lowest total score in the SPIN questionnaire was 25. Therefore, in this article, the cutoff value for social anxiety variable for distinguishing people without social phobia from others, score 24 was used (instead of score 19 which is used in Western countries). (It is noteworthy that there is a need to establish the Iranian version of the SPIN and find the cutoff for the Iranian population, due to the different culture and social conditions in Eastern countries like Iran.)

This data was split into 2/3 of cases for a training set and 1/3 for a test set. The BN was trained with the training set using Netica (Fig. 2).

Fig. 2
figure 2

The BN model of SAD in Netica after learning

In the following section the BN model described above is evaluated using a case file of test data. Then the results obtained using the BN model in the diagnosis of social anxiety are presented.

5 Testing the model and results

Before the network can be used in real-life practice, its quality has to be established. One of the techniques for assessing a network’s quality is to perform a sensitivity analysis with data that serves to provide insight in the robustness of the output of the network to possible inaccuracies in the underlying probability distribution (Lucas et al. 2004).

Netica has provided an interface to test the BN using a case file of test data. The node(s) of interest for prediction are treated as “unobserved nodes”. Social anxiety is used as an unobserved node in our test. The purpose of this test is to grade the BN using a set of real cases to see how well the predictions or diagnosis of the network match the actual cases. The BN was tested with the test set using Netica. In the test report, the error rate was 14.38 %. This means that in 14.38 % of the cases, the network predicted the wrong value.

Results of the test are listed in Table 1. The accuracy of a test depends on how well the test separates the group being tested into those with and without the disease in question. The receiver operating characteristic (ROC) curve is obtained by plotting pairs of true positive rate (sensitivity) and false positive rate (1-specificity) in Fig. 3. Accuracy is measured by the area under the ROC curve. An area of 1 represents a perfect test; an area of 0.5 represents a worthless test. A rough guide for classifying the accuracy of a diagnostic test is a traditional point system: 0.90–1, excellent; 0.80–0.90, good; 0.70–0.80, fair; 0.60–0.70, poor; and 0.50–0.60, fail (Swets 1988).

Table 1 Results of evaluation using test data
Fig. 3
figure 3

Evaluation using test data

As a result, the area of 0.898 represents an excellent test (as shown in Fig. 3). The area under the curve (AUC) is used as a measure of overall test performance.

As it can be observed in Fig. 2, the probability of a certain student to be diagnosed with social anxiety, depending on no evidence, is approximately 38.7 %.

The influence of changing the values of only one evidence node at a time on the probability of diagnosing a student with social anxiety is shown in Fig. 4.

Fig. 4
figure 4

The probability of diagnosing a student with social anxiety, taking in consideration only one evidence at time

Except for the variables of BI and negative self-evaluation, the increase in which results in fluctuations in the probability of social anxiety, in other variables, with the increase of the severity of a factor, the probability of social anxiety also increases.

The variable of social self-efficacy (X13 node) naturally acts in the contrary manner and with its increase, the probability of social anxiety decreases.

As can be seen in Fig. 4, the highest probability is related to severe behavioral symptoms of anxiety in social situations (X12 node).

Also, sensitivity of social anxiety node to a finding at another node by using Netica software is measured. Results are listed in Table 2.

Table 2 Sensitivity of SA to a finding at another node

Among the nodes in the lower layer of the network, the most sensitivity of the variable of social anxiety is related to the node of Behavioral symptoms of anxiety and among the nodes in the upper layer of the network, the most sensitivity is related to the node of Shyness.

6 Conclusions and future work

In this paper, Bayesian network was applied to the predictions and diagnosis of social anxiety in a nonclinical population of university students. The network was constructed manually based on the domain knowledge using some cognitive-behavioral factors and the CPTs were learned by using the Netica software. Validation of the model resulted in performance reported between 0.8 and 0.9 (an excellent test) by the area under the receiver operating characteristic curve.

Also the influence of certain variables on the probability of social anxiety was shown. The results indicate that this model can be an efficient tool for medical healthcare practitioners in diagnosis of social anxiety. However, the discussed statistical population in the present study is only limited to the students of one university. So, generalization of the findings to any other populations needs to be done with caution.

If a patient suffers from SAD, he or she is at higher risk of being diagnosed with a second disorder. The most common overlapping disorders are avoidant personality disorder, panic disorder, generalized anxiety disorder, depression, alcoholism, and eating disorders. Furthermore, many symptoms of these disorders are common to all of them. For these reasons, a BN model of these overlapping mental disorders can be constructed to assist the diagnosis of more likely disorders with having a certain disorder, based on observed evidence (causes and symptoms), pending future work.