• No se han encontrado resultados

6. Conclusiones y Trabajo Futuro 49

6.2. Limitaciones y Trabajo Futuro

Quick Reference

To define elements whose data is to be read from an integer array created in the edit section, type:

bit array_name; element_text1;element_text2; ...

Using the statements field and bit together has the same effect as fld. You would use them when you want to reorganize or otherwise manipulate the data before tabulating it.

You’ll find a full explanation of field in section 8.6, ‘Reading numeric codes into an array’ in the Quantum User’s Guide Volume 1, but we’ll explain it briefly here so you can see exactly how it relates to bit.

Quantum User’s Guide Volume 2

98 / More about axes – Chapter 4

field is an edit statement that counts the number of times a particular code appears in a list of fields for each respondent. It stores these counts in an integer array that consists of as many cells as there are fields to count. For example, if the questionnaire contains the question and response list:

you could use field to count the number of times each film was seen by each respondent. If you call the array films, films1 would contain the number of times that the respondent saw Columbus, films2 would contain the number of times that he or she saw Aliens 3, and so on. If the respondent did not see a film, the cell for that file will be zero.

To tabulate data counted by a field statement, you use bit:

bit input_array; element_specs

The input_array is the name of the integer array you created with field, and element_specs are the element texts and codes. The rules for defining elements with bit is the same as for fld, so you could tabulate the films by typing:

bit films;Columbus;Aliens 3;Pretty Woman;Green Card;Batman 2

Quantum will increment the count for Columbus by 1 whenever cell 1 of the films array is greater than zero. The value of a cell in the array has no bearing on the number by which Quantum increments the element count. As long as the cell value is greater than zero, Quantum increments the element count by 1. It does not increment the element count by the cell value; that is, it counts the number of respondents and not the number of responses.

If you want to count the number of responses, rather than the number of respondents you need to use the inc= option in the bit statement.

For further information, see the following section, ‘When bit is better than fld’.

You can group and re-order responses in the same way as with fld. For example:

bit films;Science Fiction/Fantasy=2,5;Historical=1;Others=3-4

Quantum will increment the count for Fiction/Fantasy whenever cells 2 and/or 5 are non-zero; it will increment the count for Historical whenever cell 1 is non-zero; it will increment the count for Others whenever cells 3 and/or 4 are non-zero.

Q6A: Which films did you see on your last 3 visits to the cinema?

(12-13) (14-15) (16-17) Columbus ... 01 01 01 Aliens 3 ... 02 02 02 Pretty Woman ... 03 03 03 Green Card ... 04 04 04 Batman 2 ... 05 05 05

Quantum User’s Guide Volume 2

More about axes – Chapter 4 / 99 bit does not allow detailed analysis of out-of-range or non-numeric codes. The field statement counts out-of-range codes (for example, a code 6 or 7 when the array contains five cells) in cell zero which Quantum creates for itself. Non-numeric codes such as $&&$ for ‘None of these’ are stored in a cell which you define as part of the field statement. If you want to include these types of responses in the axis, you may do so with an element of the form Out of range=rej. bit allows use of the keywords base, base=, hd= and tx=.

These are as described for fld.

When bit is better than fld

When you have numeric codes and you want simple counts of respondents, it is quicker and easier to use fld than it is to use field and bit. However, if you want to count the number of times each film was seen, for example, you will need to increment the elements of the axis by the number of times each response code appears. Normally you’d use inc= to name the column or field to use as the increment, but with fields of numeric codes this is not possible. This is where you’d choose field and bit instead of fld, because Quantum has already done some of the work for you.

You’ll remember that field increments cells of the array each time it finds a particular code. If code 01 appears in the list of fields twice, the value in cell 1 will be 2. This is the value by which you want to increment the element count, so you write a bit statement which tells Quantum to do just that. If you want an axis that shows the number of times each film was seen, you will write the bit statement as:

bit films;Base;Columbus;%inc=films1;Aliens 3;%inc=films2;

+Pretty Woman;%inc=films3;Green Card;%inc=films4;

+Batman 2;%inc=films5

If we assume that all respondents are eligible for inclusion in this axis, the base will be the total number of respondents, even though a cell may be incremented by more than one per respondent.

For information on inc=, see ‘Data options’ later in this chapter.

Incrementing tables more than once per respondent

In the previous section you saw how bit provides an quick and easy method of updating the cells in a table by more than one per respondent. In the example, the cells of the table will show the number of viewings per film, but the base will show the number of respondents eligible for inclusion in the table.

Quantum User’s Guide Volume 2

100 / More about axes – Chapter 4

Although a table of this type immediately highlights films which were seen more than once per respondent, there may be times when you want the base to be calculated on the same basis as the rest of the table; that is, it should be a count of viewings rather than of respondents. To obtain a table of this type you need to increment the base once per field rather than once per respondent.

This means reading and tabulating one field at a time. The statement which lets you do this is process. This is an edit statement which sends the record temporarily to the tabulation section. Let’s rewrite the films example using process and compare the results with the ones we obtained using bit.

For full details on process and further examples, see section 9.10, ‘Going temporarily to the tab section’ in the Quantum User’s Guide Volume 1.

In the edit we write a loop which copies the contents of each field in turn into some spare columns and then sends the record to the tabulation section for analysis. Since we do not want all tables to be incremented more than once per respondent, we set a flag in another spare column which we can use as a filter on the table which requires the extra updating.

The edit is:

ed

/* set a flag for use as filter in tab section c181=’1’

/* take each field in turn do 5 t1 = 112,116,2

if (c(t1,t1+1)=$ $) go to 5 c(182,183) = c(t1,t1+1) /* skip to tab section process

/* back from tab section, so try the next field 5 continue

/* reset filter flag for other tables c181=’ ’

. end

Quantum User’s Guide Volume 2

More about axes – Chapter 4 / 101 In the tabulation section, we write:

/* filter table so it’s only updated for process fields tab filmax region;c=c181’1’

ttlBase: Number of Viewings

/* remove filter for all other tables flt;c=c181’ ’

tab ax1 bk1 .

l filmax

fld (c(182,183));Base;Columbus;Aliens 3;Pretty Woman;

+Green Card;Batman 2;None of these=$&&$

The record passes through the entire tabulation section but only tables in which the spare column contains a ‘1’ are updated. Once all fields have been dealt with, the edit resets this column to blank so that when the edit finishes Quantum can create the other tables in the usual way.

To compare the results of using bit and process, let’s take the record:

The counts for the individual films are the same with both methods. bit and inc increment each table cell by the value of the film’s cell in the array but, because the record passes through the tabulation section once, the base is incremented only once per respondent. With process the record passes through the tabulation section once per film; the base and the individual film counts are incremented each time this happens.

0 ---+--- 1 020402

With bit With and inc= process

Base 1 3

Columbus 0 0

Aliens 3 2 2

Pretty Woman 0 0

Green Card 1 1

Batman 2 0 0

None of these 0 0

Quantum User’s Guide Volume 2

102 / More about axes – Chapter 4

Documento similar