Toon posts:

[SPSS] Variabelen in frequentietabellen

Pagina: 1
Acties:
  • 178 views sinds 30-01-2008
  • Reageer

Verwijderd

Topicstarter
Om de output van mijn onderzoek rechtlijnig te houden wil ik bij elke frequentietabel die ik uitdraai ALLE mogelijke variabelen zien, ookal is er niet op gescoord.

Een zelfde probleem heb ik met de grafieken.


Simpel voorbeeld:

Ik vraag aan mensen om hun geslacht. Dat kan natuurlijk man en vrouw zijn.
Stel dat ik nu 10 mensen benader om hun geslacht te vragen. Als dit 10 mannen zijn, genereer ik een tabel waarin alleen de kolom man wordt weergeven, omdat er op vrouw simpelweg geen score is.

Ik wil alleen bij een dergelijke tabel en ook bij tabellen met meer variabelen ALLES tonen, ookal zijn er geen vrouwen. Alleen ik kan dit niet vinden bij de opties van de freq. tabel.

Hoe kan ik dit doen?

Verwijderd

Topicstarter
Zelf nog verder gezocht en ben uitgekomen op een paar mogelijke oplossingen. Die krijg ik alleen niet normaal uitgevoerd. Misschien onkunde, misschien iets anders.

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Q.
I am running SPSS Tables.  I have a variable that has a category that
nobody responded to.  I would like to have that value displayed in my
Tables output.  How can I do this?

A.
The key here is to create a dummy case that would have the value in
question for the given variable and one valid value for any of the other
questions that will appear in the table.  Then we create a flag variable
that differentiates that case from the other cases.  Finally, we will
create the table as we normally would but would use the flag variable as
a layer variable.

Here is an example:

** Here is a dataset with two variables - VARA and
** VARB.  VARA has no cases with the value 3, and
** that is the value that we want to display in our
** table.

DATA LIST free / vara varb.
BEGIN DATA
1 1 1 1 1 2 1 2 1 3 1 3 1 4 1 4 1 5 1 5
2 1 2 1 2 2 2 2 2 3 2 3 2 4 2 4 2 5 2 5
4 1 4 1 4 2 4 2 4 3 4 3 4 4 4 4 4 5 4 5
5 1 5 1 5 2 5 2 5 3 5 3 5 4 5 4 5 5 5 5
END DATA.

** The data does not contain cases with VARA=3.
** In the Data Editor window we will add a
** case where VARA=3.  VARB can be any
** valid value (in this case, any value from
** 1 to 5).  Go to the Data Editor window, scroll to the last
** case, and MANUALLY ENTER the data for this new case.

** Then, we'll create the flag variable.

COMPUTE flag=0.
IF (vara=3) flag=1.
EXECUTE.

** Now, we can create the table.

TABLES
  /table=vara by varb by flag
  /statistics count (vara) cpct (vara:varb flag).

** Note that in the /STATISTICS subcommand,
** we specified the FLAG variable as a base
** percentage variable.  That way the percents
** on the "legitimate" table.


*One other thing you can do is to make the VARIABLE LABELS and VALUE
*LABELS in Flag a blank.  This effectively hides any layer reference.


code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
*(Q) My survey allows for 10 possible responses (1 to 10) for a given question 
    but not all responses were selected by person completing the survey. 
*   How can I include the options which have not been selected in my Table
    summarising the answers?.

*(A) Posted by Ray to spss newsgroup on 2002/05/10.


* Preparatory work.
DATA LIST FREE /a.
BEGIN DATA
1 2 3 4 5 6 7 8 9 10.
END DATA.
COMPUTE wgt=.00001.
SAVE OUTFILE='c:\temp\temp.sav'.

* Dummy data for illustration purposes.
DATA LIST LIST /a.
BEGIN DATA
1
2
4
2
4
END DATA.
LIST.

COMPUTE wgt=1.
TABLES
  /FORMAT BLANK MISSING('.')
  /TABLES a
  BY (STATISTICS)
  /STATISTICS
  count( ( F5.0 )).


ADD FILES FILE=* /FILE='c:\temp\temp.sav'.
WEIGHT BY wgt.

* Basic Tables includes all 10 categories.
TABLES
  /FORMAT BLANK MISSING('.')
  /TABLES a
  BY (STATISTICS)
  /STATISTICS
  count( ( F5.0 )).


Graag assistentie!