======Create Interview Questions======
//NOTE:// If you are coverting an existing EgoWeb install, refer to the [[multinamegenerator|information about the new multiple name generator functions and the changes to EgoWeb 2.0 authoring that require converting an older study.]] The remaining instructions for authoring have been updated for these new features.\\ \\  

Once you have [[create_interviews_study_settings|created a study in Authoring]] you can begin to construct a questionnaire. You do not need to finalize study settings before creating questions. Study settings and questions can be added and modified together.   

== Question Categories ==
There are 6 main types of EgoWeb 2.0 questions that have different properties. 5 of these question types can be created from the "Questions" option on the list of orange text menu options under the black bar with the link to the Main menu. 

The 6th type of question is created within the [[create_interviews_questions#ego_id_questions|"EgoID Questions"]] menu option. These are are only intended to be questions that help define the interview uniquely (e.g. respondent ID, interviewer ID, site ID, etc.).  At least one EgoID question is required to create an EgoWeb 2.0 interview.  [[create_interviews_questions#ego_id_questions|See below for instructions for creating EgoID questions]].    

====Questions====

|{{ :question_menu_option.png?800 |}}|
|Questions Menu Option|

The "Questions" link opens an EgoWeb 2.0 questionnaire menu. On this menu you can either create a new question or edit a previously crated question. When selecting the "Questions" menu option for the first time after creating a study, you will see one grey bar with "New" text on the left hand side.  Clicking on "New" will trigger the bar to expand and display the default question settings. Creating new questions will create additional bars on this page and display the text entered as "Title" on the bar. Opening the "Questions" menu link for an existing study will display all of the currently programmed questions. The order of the question bars from top to bottom is the order in which they appear during a live interview. 

=== Subject Type ===
In order to create a new question, the question must be given a "Title" and a "Subject Type" must be selected and then the small green "Create" button on the bottom left hand side must be clicked to save these settings. The "Subject Type" identifies which category of question you are creating.  Different "Subject Types" function differently by default (e.g. "EGO" subject types only display once) and also have different display options. The 5 main types of questions are selected with the "Subject Type" drop down selection option that is visible when a question is opened.  

|{{ :question_authoring_1.png?800 |}}|
|Selecting Question "Subject Type"|

The 5 primary question categories ("Subject Types") are:

  - [[create_interviews_questions#ego_questions|EGO]]: Respondent characteristics (e.g. respondent's gender, stress levels, respondent drug use, knowledge of HIV, etc.)
  - [[create_interviews_questions#name_generator_questions|NAME GENERATOR]]: Who is in the respondent’s network (A list of names a respondent knows, e.g. the 10 people the respondent most frequently contacts)
  - [[create_interviews_questions#alter_questions|ALTER]]: Details about network members (Alter Questions, e.g. What are your friends’ ages? Who do you have sex with?).
  - [[create_interviews_questions#alter_pair_questions|ALTER PAIR]]: Which network members know each other (Alter Pair Questions).
  - [[create_interviews_questions#network_questions|NETWORK]]: Questions about the respondent’s network visualization (Network Questions).

To create a new question in EgoWeb 2.0, click on the "New" text on the top bar within the "Questions" section. Add text to the "Title" box to name your question.  Save this new question by clicking "Create".  
|{{ :question_creation.png?800 |}}|
| Creating a new question |

TIP:  Click "Create" as soon as you name the question so that you do not lose settings.  It is easy to get distracted when you star adding settings and question text and forget that you did not click "Create".  If you do not click "Create" and then navigate to another page, you will lose all of the settings and the question will never be completed. 

Once a set of questions is created and the Questions menu page has several gray bars representing questions, dragging and dropping these bars into different locations re-orders them in the questionnaire.  Questions are displayed in a data collection interview according to the order in which they are displayed, to to bottom, on the Questions menu page. 

=== Response Types ===
For each "Subject Type" there are several different question types to capture different types of data. 

\\ **TEXTUAL**\\  Choose this option to create a question in which the respondent types in text in a text box as the answer.\\ 
|{{ :response_type_10.png?600 |}}|
| Textual Response Type Example|
\\ **NUMERICAL**\\  Choose this option if you want the respondent to choose a number as the answer. You can specify a minimum and/or maximum number the respondent can enter by clicking the Min/Max button and entering a value in the Literal box. You can also set the maximum and minimum to be linked to answers given in a previous question. The “Previous” option allows for a number entered earlier in another question to be used as the maximum/minimum for a subsequent question.\\ 
|{{ :response_type_4.png?600 |}}|
| Numeric Response Type Example|
\\ **MULTIPLE_SELECTION**\\  Select this option if you want the respondent to choose from a set of options. There are settings on the main question authoring page for displaying the question prompt, a preview for the question (blank screen with text that comes before the question), and setting a minimum and maximum number of options.\\ 
|{{ :response_type_2.png?600 |}}|
| Multiple Selection Response Type Example|

\\  After selecting this response type, you can create the set of response options. An “Options” link appears in the upper-right corner of the question box for multiple selection questions. Clicking on this link opens the “Options” page for that question.\\ 

|{{ :open_options_settings.png?800 |}}|
|Options link on multiple-selection question bar|

\\  In the options page, you can specify the set of responses the respondent will choose from. Each option is added by typing in text in the "Name" field, a number that will be exported into the "Value" field, and then clicking the "Add Option" button. The text and value will appear in the table on the left hand side of the page. The "Name" text is what will display when the question is displayed in an interview. "Value" is what shows up in the .csv file for the question after data are collected and exported.\\ \\ 
| {{ :multiple slection options.jpg?600 |}} |
| Setting Multiple Selection Options |

Note: Audio is not currently functional but previously enabled uploading audio recordings for audio-CASI. These features are currently turned off while we investigate new procedures for storing audio. 

Replace with Options from Other Question: Once you have programmed one multiple selection question with a set of options, you can import these options into any other multiple selection question. This is a time saving function because it allows you to define a set of response options and easily import the set into any question in an EgoWeb study. This is useful if questions in a study use the same set of response options repeatedly. For example, if there are a set of questions that ask respondents to rate a set of items by how much they agree or disagree (e.g. “Strongly disagree”; “Somewhat disagree”; “Somewhat agree”; “Strongly agree”), then an option list from a question that uses these same options does not have to start from scratch defining options. This also helps avoid errors in programming.

Replace with Options from Preset: Do Not Use. No longer maintained and will be removed.

\\ **DATE**\\  Choose this option if you want the respondent to select a date as the answer. Pick which time units the respondent will enter by checking the appropriate box(es) from among the options Years, Months, Weeks, Days, Hours, and Minutes.\\ 
|{{ :response_type_3.png?600 |}}|
| Date Response Type Example|

\\ **TIME_SPAN**\\  Choose this option if you want the respondent to selects a span of time as the answer. Pick which time units the respondent will enter by checking the appropriate box(es) from among the options Years, Months, Weeks, Days, Hours, and Minutes.\\ 
|{{ :response_type_5.png?600 |}}|
| Time Span Response Type Example|

\\ **TEXTUAL_PP**\\  This is a text entry box that provides a much larger text box.
|{{ :response_type_1.png?600 |}}|
| Textual_PP Response Type Example|

\\ **NO_RESPONSE**\\  This is a response option that displays the text in the question prompt box but has no data capture features.  This is for displaying information to a respondent/interviewer during the interview that does not fit a question text, introduces question types, etc.  It functions similarly to text in a preview box. 
 
|{{ :response_type_11.png?600 |}}|
| NO_RESPONSE Response Type Example|



=== Skip Logic ===
From the dropdown menu under “Skip Logic Expression,” you can choose an [[create_interviews_questions#expressions|expression to set conditional logic]] to only ask the question under the conditions of that expression. The expression defines the conditions under which the question is to be displayed to the respondent/interviewer. Therefore, if the condition is not met, the question will not be displayed.  For alter questions, skip logic determines presentation at the alter level.  Therefore, questions are displayed for the alters that meet the conditions. Instructions for [[create_interviews_questions#expressions|creating expressions are given in detail below]].

=== Question Prompt Text ===
There are text boxes for presenting text to respondents/interviewers.\\ \\ **Prompt**\\  The text box labeled “Prompt” produces text that is displayed above the data entry controls (text box, numeric entry box, response options).\\ \\ **Preface**\\  The text box labeled “Preface” produces text that is displayed on a screen prior to the display of the question. This provides a means for introducing a set of questions. The text is displayed on top of a “Next” button.\\ 
 
=== RTF and HTML Formatting ===
There are two options for displaying text formatting. The first option is to use the rich text formatting to modify the display of the text. Also, text copied and pasted from a word processing software such as Microsoft Word can be modified with rich text formatting options.

=== HTML Tags ===
The second option is to display text with different options by directly coding the HTML with HTML tags. Clicking on the HTML button in the upper left hand of the text box displays the HTML tags underlying the formatting: 

| {{ :image17.png?800 |}} |
| Using HTML tags in EgoWeb |
\\  Supported tags include:\\ 

  * <b></b> bold
  * <i></i> italics
  * <u></u> underline
  * <hr> horizontal line
  * <br /> Forced line break
  * <font size=""></font> two variations
\\  Here’s an example of how these tags change the formatting:\\ \\ 

| {{ :image18.png?800 |}} |
| How HTML codes display |

There are ways to display text in questions beyond the literal text entered into one of the question prompts. For example, showing responses to previous questions, showing text to respondents based on their previous responses, showing dates based on the current date, showing counts of types of alters, etc. Go to [[create_interviews_questions#variable_text| Variable Text Controls]] for detailed instructions on variable text question display.

====Question Types====

=== EgoID Questions ===
The next step in authoring is identifying a participant—generating a unique ID for the “ego” (the participant) who will later identify their “alters” (people in their network as relevant to the study). So if you were doing a study on peer support networks and you would use EgoID questions to identify the respondent to make them identifiable as an ego, and then later they would identify peers they rely on for support (their “alters”).\\  In this section you can create a set of questions that will be asked together on the page after the introductory page in the survey. This section is for questions asking for identifying information about the respondent, like email address and phone number.

|{{ :egoid_questions.png?800 |}}|
| Create an ego_ID question |

|{{ :egoid_question_settings.png?800 |}}|
| EgoID question settings |

**Tip:** You can use the blue “Preview” button to see what your question looks like, however this counts as navigating away from the page—save changes first or you will lose them!

When an interview is conducted, the responses that are entered in on the EgoID page are used to create the unique ID for the respondent.  This ID is a combination of each response concatenated with underscores. Each page of the interview displays this ID. 

|{{ :egoids_on_questions.png?800 |}}|
| EgoID displays on each question page |

There are two response types that are only available in the EgoID question settings: RANDOM_NUMBER and STORED_VALUE.  These two types do not display on any EgoWeb interviewing screen. They are hidden to interviewers and respondents.  They are used to generate behind the scenes values for interview control.  

The RANDOM_NUMBER option creates a random number for each interview between the max and min values.

|{{ :random_number_generator.png?800 |}}|
| EgoID question with RANDOM_NUMBER setting |

STORED_VALUE has only been used for studies that are triggered by an external software that launches EgoWeb and passes data into an interview from an external source.  

=== Ego Questions ===
Subject Type: EGO questions are question that will be presented on one screen.  They are usually used to ask respondents questions about themselves, such as their attitudes about something or characteristics of the respondent, like the respondent’s age, level of education, stress level, or drug use.\\ 

\\  NOTE: In previous versions of EgoWeb 2.0, Ego questions were the first set of questions after the ID questions. Now questions are more flexible to better enable multiple name generators.  Questions can now be ordered throughout the interview by clicking on the question bar, holding the click and moving the question bar up and down and releasing it where you want it to be presented. If you updated an older version of EgoWeb to this new version, read [[multinamegenerator|this page on the conversion to the new format]]. 


|{{ :questions_menu.png?800 |}}|
| Questions menu | 
 
Clicking on a question bar opens up the question options.  Ego questions have some different options than alter, alter pair, network questions, etc. but many settings are the same across Subject Types. Some settings are immediately visible and others require scrolling down with the inside scroll bar within the question settings box. 

The main settings for an ego subject type are displayed below:
|{{ :ego_question_1.png?800 |}}|
| Settings for a Ego Question | 

Additional settings appear when scrolling...

|{{ :ego_question_2.png?800 |}}|
| Settings for a Ego Question | 

And even more additional settings appear when scrolling some more... 

|{{ :ego_question_3.png?800 |}}|
| Settings for a Ego Question | 

And finally...
|{{ :ego_question_4.png?800 |}}|
| Settings for a Ego Question | 

In general the most used and most important to modify settings are at the top of the question settings box.  Most of the settings that require scrolling can be left as defaults or ignored completely.  


=== Stem and Leaf Ego Questions ===
For the most part, ego questions and displayed one per page.  Saving a response requires clicking the "next" button.  However, several ego questions can be displayed on the same page if they are actually several sub-parts of the same main question (a.k.a "stem and leaf" question, that is, a single “type” of question, all which can show up on the same interviewing page).\\ 

Most of the stem and leaf options are exactly the same for each question.  This includes the prompt text, the settings for Response Type, including Options, and the selection of the "Leaf and Stem Question" check box. 
| {{ :stem_and_leaf_1.png?800 |}} |
| Stem and leaf options |

\\ \\  Scroll down for more fields:\\ 

The last choice in building an EGO Stem and Leaf Question is putting in the "leaf" part of the questions. Besides the question names, the "leaf" prompt text is the only unique setting for a series of Stem and Leaf Questions. 

|{{ :ego_question_3.png?800 |}}|
| Settings for "leaf" part of Stem and Leaf | 

Leaf and Stem questions are the specific questions under the broader prompt. Think of a specific question as a stem, and if it has additional questions in the same vein, they will be leafs on the stem. So in our notional example of asking about mood and mental health:\\ 

  * The Prompt alerts the participant that they’ll be answering questions about their feelings over the last 30 days.
  * Leaf & Stems are the specific questions about mood and mental health, and we might have multiple leaves under the first stem: has the respondent felt happy, sad, agitated, etc.?
  * The Preface is a transition signal, for example shifting to questions about stress levels in the workplace and home. Having text in the Preface box will break up a stem and leaf series. Therefore, only put text in this box if you really do want to transition to a new series of questions. 
\\ 
In the Interviewing mode, our example question will appear as follows:\\ 

| {{ :stem and leaf.jpg?800 |}} |
| Stem and Leaf Question Example |
 
=== Name Generator Questions ===
Although EgoWeb 2.0 can be used to only ask questions of a respondent about themselves, the heart of EgoWeb 2.0 is asking respondents about other people to generate social network data.  The Name Generator question is designed to guide respondent (or guide an interviewer who is guiding a respondent) to provide a list of names. 

Name generator question types are by default set to "Textual" questions because their only function is to gather a series of text names.  
| {{ ::5_name_generator_type.jpg?800 |}} |
| Questions can be set to Name Generator in any part of survey. |

Each NAME_GENERATOR question can be given a a "max" and "min" limit on the number of alters to be generated with each name generator. Leaving these blank will result in a name generator without either a floor or ceiling maximum on number of alters.  

| {{ ::name_gen_1.png?800 |}} |
| Name Generator Question Example |

Setting a minimum will disable the "Next" button until the minimum is reached.  The only way to move forward to the next question without entering at least the minimum number of alters is to enable the "Don't Know" or "Refused" buttons. Once the maximum number of names is reached, the text box for entering names disappears and the only controls are to go forward or backwards in the interview.   

| {{ ::6_name_generator_settings.jpg |}} |
| Name generator settings within question |

| {{ ::name_gen_2.png?800 |}} |
| Name Generator Question Example |

| {{ ::name_gen_3.png?800 |}} |
| Name Generator Question Example |

| {{ ::name_gen_4.png?800 |}} |
| Name Generator Question Example |


Text can be displayed for the interviewer/respondent to know how many responses have been given and how many there are still to provide. These "Variable alter prompts" are created within each name generator question. They can also be created with a text editor or Excel and imported as an external .csv text file into each name generator question.  The file should be formatted with two columns and no headings.  The first column is the number of alters when the message should be displayed and the second column is the text to be displayed.  
| {{ ::7_variable_alter_prompt_settings_and_import.jpg |}} |
| Variable alter prompt controls |

More than one name generator can be included in an interview.  Each name generator builds onto the same list.  Alter names are exported along with an indicator variable for which name generator questions generated the alter name. 

| {{ ::name_gen_5.png?800 |}} |
| Name Generator Question Example |


=== Alter Questions ===
ALTER subject type questions should be located after the appropriate name generator(s). Alter questions have some similar settings as EGO Subject Type questions but are customized to be presented for a list of names. ALTER type questions have settings that enable presentation of questions about alters in different ways. 

\\  There are two ways to ask questions about each alter: Ask the question once for each alter, or ask the question once and then specify the answers for all the alters on the same screen.\\ 

  * To ask the question separately for each alter, in the Prompt box of the question ask the question in the following way: “Did you ever drink more alcohol than you usually do or do more drugs than you usually do when you were with $$." EgoWeb will recognize the special code "$$" and will fill in the name of each alter on the alter list one at a time. The question will show up repeatedly, once for each alter, until the list is exhausted. If skip logic is used, the question will only show up for each alter that satisfies the skip logic test. For example, if you have a question that is meant for only female alters and have a question about the gender of the alters, you can create an expression that will only show an alter question for the alters who received a "female" response to the previous question.
  * To ask the question about all the alters at once on the same screen, select the “**Asking Style List**” option. Then phrase the question in the following way: “Did you ever drink alcohol with each of the following friends?” Skip logic for "Asking Style List" alter questions will only display the alters who satisfied the logical test.
\\ 
| {{ :asking style list option.jpg |}} |
| Asking Style List Alter Question option selection |

At this point we have already programmed how alters will be generated during the interview with a Name Generator question. Alter Questions ask about the relationship each respondent has with only the alters they named in response to the Name Generator. Alter questions are used to capture the character and quality of the relationship or interaction between the ego and his/her named alters. Typical alter questions might ask how frequently the ego and alter interact, how pleasurable or collegial is the interaction, or whether they do a particular activity with an alter (e.g. drinking partner, romantic partner).\\ \\  To start programing Alter Questions, click on the Questions menu and click “New” to generate a new question. Click on the "Subject Type" drop down option and select "ALTER"\\ 

| {{ :alter_question_1.png |}} |
| ALTER Subject Type selection |

The example question below is about gift giving in the network. There is a long tradition in sociology and anthropology regarding the social functions and meanings of gift exchange, so this is a good type of alter question. We can begin by asking the monetary value of the largest gift that ego typically gives to each alter over the course of a year. Here is how we might program such a question:\\ 

| {{ :alter_question_2.png?800 |}} |
| How to program an alter question |

\\  Note that we have programmed this question to be numerical. We added a note in brackets for the interviewer that they should enter a value of 0 if ego says they typically don’t give any gifts to a particular alter over the course of a year. After clicking create, you will see the new Alter Question appear as its own bar when you select Alter Questions from the black bar:\\ 

\\  This is how the Alter Question “Gifts” will appear when conducting an interview in Interviewing Mode:\\ \\ 

| {{ :alter_question_3.png?800 |}} |
| How the new alter question will display |

Here is an example from another survey of how a multiple selection response type about would look as an Alter Question in the Interviewing Mode. This particular multiple selection question categorizes alters based on blood relative status:\\ 

| {{ :alter_question_4.png?800 |}} |
| A multiple selection alter question example|

Questions about alters can also be asked one alter at a time.  Include "$$" to identify the focal alter.  The name of the focal alter will display. 

| {{ :alter_question_8.png?800 |}} |
| Non list alter question settings |

| {{ :alter_question_9.png?800 |}} |
| Non list alter question example |

There are additional settings for alter questions that have multiple selection response type and asking style list.  

You can limit the number of alters that are selected by checking the "Set List Limit" check box.  

| {{ :alter_question_5.png?800 |}} |
| Set a List Limit |

You can provide interviewers or respondents the ability to check several rows at a time with the "Set All" settings.  This should be used with caution as respondents may use it to jump past a question more quickly.  

| {{ :alter_question_6.png?800 |}} |
| Set All Bar settings |

| {{ :alter_question_7.png?800 |}} |
| Set All Bar |


=== Alter Pair Questions ===
Alter Pair questions ask about the respondent’s perceptions of the interaction of members of their network. Examples of this type of questions is if the alters know each other or how often each of the respondent’s network members has spent time together during the past month.\\ 

When creating this type of question, use “$$1” in the prompt box to denote the name of the alter who is the subject of the question. As with alter questions, this type of question can be asked once separately for each alter or asked about all the alters at once on the same screen. See the instructions in the alter questions section of this document for creating these two styles of alter-pair questions.\\ \\  Name Generator questions ask survey respondents to name individuals from their social network. The Alter Pair Questions ask the respondent about whether and how those individuals know each other (at least to the respondent’s perception). These differ from Alter Questions in which the respondent qualified the relationship that they themselves have with the named alter. In the Alter Questions the respondent might have specified how frequently they interact with each alter, the positive or negative affect of the interaction, etc. Any of those same questions can be asked for the respondent to answer about how the alters interact with each other, i.e. Alter Pair questions.\\ \\  In practice, most surveys have fewer Alter Pair Questions than Alter Questions. This is in part because there are many pairwise possible interactions among the alters and we do not want to over-burden the respondent. More substantively, the respondent likely does not have the ability to know about the relationship between two other people with any detail and there are only so many questions they can adequately answer about these ties.  For both these reasons, Alter Pair Questions usually focus on how well the alters know one another, how frequently they interact, and whether they have a positive or negative tie (i.e. friend or foe). Any question, however, can be asked about how the alters interact if it is germane to the research endeavor.\\ 

\\  Here are examples of how to program a question about the frequency with which two individuals interact:\\ 

| {{ :alter_pair_1.png?800 |}} |
| Alter pair question settings with Asking Style List Option |

| {{ :alter_pair_2.png?800 |}} |
| Alter pair question setting non-list |


\\  First pick ALTER_PAIR subject type in a new question. Like other questions you can add a Title for the question, the prompt to the interviewer or respondent, and program the response type. In this case we will program a multiple selection response for the frequency of alter interactions. 

Similar to Alter questions, you can check “Asking Style List” option or not. Most of the time, presenting alter pair questions with the list option makes sense to reduce respondent burden.  Otherwise EgoWeb 2.0 will ask the question over and over for each possible pair, which is only a feature for some very specific applications. \\ 

In the Interviewing mode, alter pair questions using the asking style list option will appear as follows. As you can see, the questions are based on how well each alter knows the other alters. There will be a screen for each alter except the final alter.  The list of alters will get smaller (by 1) with every new screen. The final alter will not be the final focal alter because the relationship between the two final alters is evaluated when the next to last alter is the focal alter.\\ 
| {{ :image37.png?800 |}} |

Other options for ALTER_PAIR questions are the same as ALTER subject type. 

=== Network Questions ===
After all the survey questions about the respondent and alters have been asked, EgoWeb will generate a visualization of the respondent’s network of alters for him/her to see and comment on. In this section, you can create the set of questions that asks for the respondent’s thoughts on seeing this network of his/her friends.\\ 
| {{ :network_1.png?800 |}} |
| Creating a Network Subject Type question |

Network questions use the respondent’s answers to the alter pair questions to build and illustrate a personal egocentric network. The interview respondent is then shown the network that s/he helped “create” by answering individual questions during the interview. This is often a powerful experience for respondents, who are impressed and surprised by the network diagram that they created “with their own words.” Respondents can be asked for general or specific impressions about the network (or network components), which can then be typed in a text box (see red arrow on the left in the figure below). Instead of a text box response, this can also be multiple choice question. Additionally, interviewers can ask questions about specific network members, which can be entered into a Notes field corresponding with each node (see red arrows on the right in the figure below). To initiate the Notes field for a particular alter, simply click on the node and the Notes box will appear. Then click the “Save Note” button to save the response for that alter (shown with a red arrow near the bottom of the figure).\\ 
| {{ :image39.png |}} |

To illustrate how to create the network question as it appears above (in Interviewing mode), we turn to the Authoring section, Network Questions tab:\\ 
| {{ :image40.png?800 |}} |

When designing these questions, you can adjust node size, color, and shape to correspond to specific responses to alter questions. You can also specify how connections among network members appear, based on responses to the alter pair questions (network structure). Finally, node size, shape, and color can correspond with network characteristics, such as centrality. In the following network question, alters that are relatives are marked as a star. Nodes are colored red if the respondent indicated some degree of emotional closeness. Meanwhile, connections among alters that interact on a regular basis are red and slightly darker. Nodes that are larger have greater betweenness centrality. Finally, this network illustrates all connections among nodes – not just those that interact regularly.\\ 
| {{ :image41.png?800 |}} |

These options for network and node size, color, etc. can be set in the lower half of the questions authoring field.\\ 
| {{ :image42.png?800 |}} |

//NOTE:// If no expression is selected for "alter is adjacent when", the question will appear and function just like an ego level question.\\ \\  Options can be set for node shape and size as well. Here, COMP3 is an alter question asking whether each network member is a relative or not. And node size is set to correspond with betweenness centrality (can also be set to Eigenvector centrality or degree centrality).\\ 
| {{ :image43.png?800 |}} |

Edge color and size (line thickness) can also be associated with structural network characteristics:\\ 
| {{ :image44.png?800 |}} |

==== Expressions====
Expressions are a way to program conditional logic into EgoWeb survey questions. Each expression produces a “true” or “false” result that either controls if Ego questions are presented/not-presented, if alters are listed/not-listed for alter level questions, or if lines/edges are displayed in Network Questions.\\ \\  Expressions are used to program skip logic in social network surveys. Expressions use logic attached to single or multiple questions to determine whether to skip certain questions based on responses to other questions. The example below is a “Simple” expression that can be used to skip questions in a survey when a respondent has indicated that s/he has felt “sad or blue in the last 30 days.”\\ {{ :image45.png?800 |}}\\  Expressions can also be constructed of multiple simple expressions linked together – or simple expressions plus the two other types of expressions – Counting and Comparison. For example, the compound expression below would be true (Skip) if the respondent had both used drugs in the last 30 days and also had sought clinical help in the last 30 days:\\ {{ 
 :image46.png?800 |}}

=== Counting & Comparison Expressions ===
Think of Counting and Comparison expressions as a way to count responses and then compare the result to a predetermined threshold for skipping. For example, imagine in our notional peer support study, we asked Ego Questions about stressors, mood, and substance use, and we want to use the answers to those questions as a proxy for our distress that will inform our skip logic: if the respondent answers yes enough times to those questions, we will skip to a section on feelings of distress.\\ 

**Tip:** Comparison expressions require counting expressions—build or reuse a counting expression before you try and build a comparison, because you will be comparing the answer to the counting expression to a threshold number.
\\ {{ :image47.png?800 |}}\\  Once you have a Counting expression, you can create a Comparison expression that uses it:\\ \\ {{ :image48.png?800 |}}\\ 

==== Variable Text ====
There are also five HTML/XML-style tags that can be used to customize EgoWeb question prompts:\\ 
\\ **<VAR (question) />**\\  The answers to the question with the name specified in (question) is placed inline in the text. All types of questions can be referenced, with multiple-selection questions inserting the list of responses one row for each response.\\ \\  If a question included an “OTHER SPECIFY” item, that item was selected, and the text box was used, the contents of the “Specify Other” text box are included.\\ 
\\ **<CALC (question) (op) (question) />**\\  This will perform simple mathematical operations on question results. An example is <CALC Q1+Q2-Q3 />. (op) represents the comparison operator; the operations +, -, *, and / are supported, and operation is evaluated in a left-to-right order.\\ \\  You can include any type of question, but results are undefined if they are not of the type NUMERIC. That is, you can include a TEXT question that is commonly answered with a number, and it will work fine until someone answers with a string.\\ 
\\ **<COUNT (question) (answer) />**\\  This counts the number of times a question was answered with the value specified in (answer). You should put the answer you want to count in quotes. This is for use with SELECTION and MULTIPLE SELECTION questions but can also be used with TEXT and NUMERIC questions. This counts ALL the answers to the question, so it can be used to determine how many alters answered the question a given way.\\ 
\\ **<CONTAINS (question) (answer) />**\\  This is very similar to the COUNT tag but only checks whether the current interviewee (ego, “current” alter, or “current” alter_pair) answered the question with the value specified in (answer), so it will always return a value of 0 or 1.\\ 
\\ **<DATE (function/question) (op) (unit)** />\\  You can display dates in various ways or dates relative to other dates, such as the current date or a date response. 

  * **<DATE NOW** />
    * This displays the current date. "Now" in the above is a function that is not case sensitive.
  * **<DATE NOW -6 MONTH />**
    * This displays a calculation based on the current date. The example above is MONTH.
    * MONTH in the tag above could be replaced with DAY, YEAR, HOUR, MINUTE, etc
  * **<DATE question_title +1 MONTH />**
    * If an EgoWeb question was named "question_title", the above would display one month after the date stored in "question_title
    * MONTH in the tag above could be replaced with DAY, YEAR, HOUR, MINUTE, etc.

\\ **<IF (question or TAG) (op) (value) “Text to include” />**\\  This compares a NUMERIC question to a specific value, and if this comparison holds, it shows the text specified. An example is <IF ego_age <= 52 “you sure are young!” />. It supports anything that resolves to a numeric value on either side of the operand, so the value and the question can be switched, two question results can be compared, or you can use the CALC, COUNT, or CONTAINS tag on either side of the operand.\\ \\  Two or more of these IF statements can be used in succession to achieve an “if else” logic. An example of this is “So you say you are <IF EGO_AGE==40 “forty” /> 40 "over forty" /> years old." So if EGO_AGE is 40 the result is "So you say you are forty years old", and if EGO_AGE is greater than 40 the results is "So you say you are over forty years old". If the variable you are trying to compare is not NUMERIC, you can use the CONTAINS tag instead the IF tag for comparisons.\\ \\  For the above tags, the following comparison operators can be used in the (op) part of the tags:\\ 

  * **<** less than
  * **<=** less than or equal to
  * **>** greater than
  * **>=** greater than or equal to
  * **==** equal to (Please note TWO equal signs)
  * **!=** NOT equal to
\\  All tags require exact typing: there cannot be a space between the opening “<” and the tag name, and the ending for each tag must be “/>”. These tags also only work with questions that contain no spaces and don’t consist only of digits, so “Q1” will work, but “Q 1” and “1” would not work.

==== Using Option Lists From Already Programmed Questions ====

{{ :image50.png?800 |}}\\  **DO NOT USE "Replace with options from preset". This is an outdated feature that is not being supported and will eventually be removed from EgoWeb.

//Option Lists: *** DO NOT USE** * WILL BE PHASED OUT OF FUTURE VERSIONS// ====
\\  The Option Lists page was initially used to store multiple selection response options to be imported across questions. This feature has been replaced by the addition of the feature to import response options from other questions. This made the options list functionality redundant but required work to keep it updated and debugged. It is going to be eliminated eventually.\\ \\ 

| {{ :dont use options lists.png?800 |}} |
| Do not use "options from preset" |

~~DISCUSSION~~