online QDA logo - Home Page



Bookmark and Share

NVivo logoNVivo Automatic coding and node creation

Author of this page: Graham R. Gibbs

Affiliation: University of Huddersfield

Date written: 30th June 2005





Symbols and Conventions


If your documents are structured then there are facilities in NVivo to make initial coding easier. This is most often the case with semi-structured interviews where you may want to code the answers to each question at a  separate node, bringing all the answers to the same question from each person under the same node. For example the responses from a structured interview may be broken up into sections, each on a different topic. A node could be set up for each of these and then the section of each interview that covered that topic could be coded at the node. Another situation where such automatic coding would be useful is where you have the transcript of a focus group and you would like to code everything said by each person to a node with their name. In either case there is a simple way of setting up a group of such nodes in NVivo.

Prepare the documents

You should ensure that you have formatted your documents correctly before you do this. It is probably easiest to do this before they are introduced into NVivo, but you can do the formatting in the Document Browser in NVivo. Figure 1 shows a document with some formatting for automatic serial coding. The headings (showing in bold) have been put into the style Heading 1 or Heading 2. Headings are used to create sections in NVivo. You can see the sections created by selecting the document in the Document Explorer, see Figure 2. When you create the section headings (in the styles Heading 1, Heading 2 etc.) it makes sense to ensure that they are consistent across documents. It is important both for automatic coding and also for any other search operation that they are spelt exactly the same in each document. Cutting and pasting from one document to another is the best way to ensure this and can be done in Word or in NVivo. That way when you automatically code your documents you can ensure that all the same sections are coded to the same node.

Document Browser showing a document formatted for serial coding.

Figure 1. Document Browser showing a document formatted for serial coding.

The document sections as shown in the Document Explorer

Figure 2. The document sections as shown in the Document Explorer.

These sections can be coded automatically using the Section Coder.

To code a sectioned document automatically,

  1. Create a tree node - called the parent tree-node - under which you wish to establish the new nodes. N.B. if you have already done this with another document (or have already created the node) then you can use that node.
  2. In the Document Explorer click the document that has the appropriate sections.
  3. click Document:Code by Section... from the menu bar (or use the contextual menu right click ).
  4. This displays the Section Coder. See Figure 3.
  5. click the radio button, Code sections by title.
  6. Choose the parent tree node under which you wish the new nodes to be placed.To do this, click the Choose... button and selecting from the dialog box that is displayed.
  7. click OK.


The Section Coder

Figure 3. The Section Coder.

In the Node Explorer you will now find a new tree of nodes attached to the parent node you selected (assuming this is the first time you have done this). For each of the main section headings (formatted in a Heading1 style) in the document there is a node. The wording of the heading (truncated to 36 characters including spaces) is the node title. See Figure 4. There are also nodes for each of the subsections of the document (formatted in a Heading2 style). Thus in Figure 4 the nodes INT_SALLY and HARRY have been created. As you will see in Figure 1, every question asked by Sally has a heading INT_SALLY and every reply by Harry has a heading HARRY. If you browse the text now coded at these new nodes you will find coded at INT_SALLY every question she asked and at HARRY every answer he gave. In other words the program has recognized that the text in sections in the document with the same title should be coded to the same node.

Node tree established by coding sections by title

Figure 4. Node tree established by coding sections by title.

If the document you have coded this way is a focus group discussion and you have only used one level of Heading style, this is probably what you want. All the text said at any point in the discussion by a particular respondent will have been coded under the node with their name (e.g. HARRY in Figure 4). However, in a study where each document records the speech of one respondent such identifiers are probably redundant since the name of the document will tell you who is speaking. If so then either don't make the names of interviewers and respondents subheadings when you format the document, or, if you want to use styles for aesthetic reasons, just delete the unwanted nodes.

If you do need both headings and subheadings in your document (using Heading 1, Heading 2, Heading 3 styles etc.) then you will also find that only the text from one heading to the start of the next heading - even if that is a subheading - has been coded to the node with the heading title. See Figure 5. Again this may be what you want, but it is more likely that you want all the text from the start of a section up to the start of the next section, at the same level, to be coded to that section node. Thus in the example in Figure 5 you would want not only the heading Application Experience to be coded to the node Application experience, but also the following questions by Sally and answers by Harry that all relate to that topic. There are two ways to achieve this. Either should be done after you have section coded all the documents that share the same headings because they will fix this for all documents at once. However, if you do introduce and section code additional documents later, then you can simply repeat the procedure. A drawback to both procedures is that they can only be applied to one node at a time.

Document Browser for a section node showing only the title coded

Figure 5. Document Browser for a section node showing only the title coded.

To extend the coding of a section title node to all the text in that section,

  1. click the section title node in the Node Explorer
  2. Browse the node (click on the Browse button). You will see that only the title and any text up to the next section heading has been coded. Also notice that the node in question is showing in the Speed Coding Bar.
  3. Select all the text. Ctrl-A or Edit:Select All from the menu bar. Then either
  4. click Tools:Spread Passage from the menu bar (or use the contextual menu right click) and click the Enclosing Section radio button from the dialog that appears, or
  5. click View:Passage Contents Display:In Enclosing Section (to display all the section), select all the text again (Ctrl-A) and then click the Code button.
  6. Now the whole section (ignoring any subsections) is coded.


N.B. If you repeat this process on a node whose coding you have already spread to the whole section then you will spread the coding to all the text in the section a level higher than the one you are working on, which might be the whole document. This is because the program assumes that if you have already coded all a section at a node then spreading to the enclosing section means spreading to the section enclosing the current one. So generally don't do this.

top of page