Display Values in different variables

classic Classic list List threaded Threaded
5 messages Options
Tom
Reply | Threaded
Open this post in threaded view
|

Display Values in different variables

Tom
Hi there!

 

I have a dataset, in which the age of the children of families are
values in different variables: it has been the result of my rather
complicated solution in mrInterview to offer to the respondents the
possibility to answer according to the number of their children.

 

Therefore AlterKind1 contains the age of the child in the case, the
family has just one child, AlterKind21 and AlterKind22 contain the age
of the two children in the case, a family has two children etc...

AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32 AlterKind33
AlterKind41 AlterKind42 AlterKind43 AlterKind44

 

Now I'd like to display the frequencies of the ages (1 till 18) of all
children for all of the cases (y-axis number, x-axis age 1 to 18), but I
can't figure out how to do this with SPSS 16.0.

 

Thanks for your help.

Thomas

 

====================To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

AW: Display Values in different variables

la volta statistics
Hi Thomas

Use the command VARSTOCASES to get all the ages into one variable.
I made you an example (see below). Ignore the warnings when the dataset is
created.

Hope this helps, Christian

*******************************
la volta statistics
Christian Schmidhauser, Dr.phil.II
Weinbergstrasse 108
CH-8006 Zurich
Tel: +41 (043) 233 98 01
Fax: +41 (043) 233 98 02
email: mailto:[hidden email]
internet: http://www.lavolta.ch/



* Start example.

New File.
DATASET CLOSE ALL.
DATA LIST list   /ID
                        AlterKind1
                        AlterKind21  AlterKind22
                        AlterKind31  AlterKind32 AlterKind33
                        AlterKind41  AlterKind42 AlterKind43 AlterKind44 .
BEGIN DATA
1  3
2  . 4 5
3  . . . 6 7 8
4  . . . . . . 9 10 11 12
5  4
6  . 5 6
7  . . . 7 8 9
8  . . . . . . 10 11 12 13
5  5
6  . 6 7
7  . . . 8 9 10
8  . . . . . . 11 12 13 14
9  7
10  . 7 8
11  . . . 10 11 12
12  . . . . . . 13 15 17 18
END DATA.

*Ignore the warnings.

VARSTOCASES /ID = id1
 /MAKE Age FROM AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32
  AlterKind33 AlterKind41 AlterKind42 AlterKind43 AlterKind44
 /INDEX = Index1(10)
 /KEEP =  ID
 /NULL = KEEP.

Select if (not missing(age)).

DATASET DECLARE Dataset2.
AGGREGATE
  /OUTFILE='Dataset2'
  /BREAK=Age
  /n_Counts=N.

DATASET ACTIVATE Dataset2.

Var Label n_counts 'Anzahl Kinder'
         /Age 'Alter (Jahre)'.

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Age n_Counts MISSING=
  LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: Age=col(source(s), name("Age"), unit.category())
 DATA: n_Counts=col(source(s), name("n_Counts"))
 GUIDE: axis(dim(1), label("Alter (Jahre)"))
 GUIDE: axis(dim(2), label("Anzahl Kinder"))
 SCALE: cat(dim(1))
 SCALE: linear(dim(2), include(0))
 ELEMENT: point(position(Age*n_Counts))
END GPL.

* End example.

-----Ursprungliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]]Im Auftrag von
Balmer Thomas
Gesendet: Dienstag, 12. August 2008 11:51
An: [hidden email]
Betreff: Display Values in different variables


Hi there!



I have a dataset, in which the age of the children of families are
values in different variables: it has been the result of my rather
complicated solution in mrInterview to offer to the respondents the
possibility to answer according to the number of their children.



Therefore AlterKind1 contains the age of the child in the case, the
family has just one child, AlterKind21 and AlterKind22 contain the age
of the two children in the case, a family has two children etc...

AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32 AlterKind33
AlterKind41 AlterKind42 AlterKind43 AlterKind44



Now I'd like to display the frequencies of the ages (1 till 18) of all
children for all of the cases (y-axis number, x-axis age 1 to 18), but I
can't figure out how to do this with SPSS 16.0.



Thanks for your help.

Thomas



=======
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Tom
Reply | Threaded
Open this post in threaded view
|

AW: Display Values in different variables

Tom
Hi Christian

Thanks, I tried, but it didn't run. I just replaced the variable ID of your example with my serial number which is Respondent_Serial (twice within the VARSTOCASES Command), then started with VARSTOCASES with my original dataset.
I'v got this warning:
Unterbefehl Respondent_Serial nicht erkannt.
Dieser Befehl wird nicht ausgeführt.

So, ID isn't a Variable, but a subcommand?



-----Ursprüngliche Nachricht-----
Von: la volta statistics [mailto:[hidden email]]
Gesendet: Dienstag, 12. August 2008 12:43
An: Balmer Thomas; [hidden email]
Betreff: AW: Display Values in different variables

Hi Thomas

Use the command VARSTOCASES to get all the ages into one variable.
I made you an example (see below). Ignore the warnings when the dataset is created.

Hope this helps, Christian

*******************************
la volta statistics
Christian Schmidhauser, Dr.phil.II
Weinbergstrasse 108
CH-8006 Zürich
Tel: +41 (043) 233 98 01
Fax: +41 (043) 233 98 02
email: mailto:[hidden email]
internet: http://www.lavolta.ch/



* Start example.

New File.
DATASET CLOSE ALL.
DATA LIST list   /ID
                        AlterKind1
                        AlterKind21  AlterKind22
                        AlterKind31  AlterKind32 AlterKind33
                        AlterKind41  AlterKind42 AlterKind43 AlterKind44 .
BEGIN DATA
1  3
2  . 4 5
3  . . . 6 7 8
4  . . . . . . 9 10 11 12
5  4
6  . 5 6
7  . . . 7 8 9
8  . . . . . . 10 11 12 13
5  5
6  . 6 7
7  . . . 8 9 10
8  . . . . . . 11 12 13 14
9  7
10  . 7 8
11  . . . 10 11 12
12  . . . . . . 13 15 17 18
END DATA.

*Ignore the warnings.

VARSTOCASES /ID = id1
 /MAKE Age FROM AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32
  AlterKind33 AlterKind41 AlterKind42 AlterKind43 AlterKind44
 /INDEX = Index1(10)
 /KEEP =  ID
 /NULL = KEEP.

Select if (not missing(age)).

DATASET DECLARE Dataset2.
AGGREGATE
  /OUTFILE='Dataset2'
  /BREAK=Age
  /n_Counts=N.

DATASET ACTIVATE Dataset2.

Var Label n_counts 'Anzahl Kinder'
         /Age 'Alter (Jahre)'.

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Age n_Counts MISSING=
  LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: Age=col(source(s), name("Age"), unit.category())
 DATA: n_Counts=col(source(s), name("n_Counts"))
 GUIDE: axis(dim(1), label("Alter (Jahre)"))
 GUIDE: axis(dim(2), label("Anzahl Kinder"))
 SCALE: cat(dim(1))
 SCALE: linear(dim(2), include(0))
 ELEMENT: point(position(Age*n_Counts))
END GPL.

* End example.

-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]]Im Auftrag von
Balmer Thomas
Gesendet: Dienstag, 12. August 2008 11:51
An: [hidden email]
Betreff: Display Values in different variables


Hi there!



I have a dataset, in which the age of the children of families are
values in different variables: it has been the result of my rather
complicated solution in mrInterview to offer to the respondents the
possibility to answer according to the number of their children.



Therefore AlterKind1 contains the age of the child in the case, the
family has just one child, AlterKind21 and AlterKind22 contain the age
of the two children in the case, a family has two children etc...

AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32 AlterKind33
AlterKind41 AlterKind42 AlterKind43 AlterKind44



Now I'd like to display the frequencies of the ages (1 till 18) of all
children for all of the cases (y-axis number, x-axis age 1 to 18), but I
can't figure out how to do this with SPSS 16.0.



Thanks for your help.

Thomas



=======
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

AW: Display Values in different variables

la volta statistics
For the purpose to make just the chart you can use the following VARSTOCASES
command:

VARSTOCASES
 /MAKE Age FROM AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32
  AlterKind33 AlterKind41 AlterKind42 AlterKind43 AlterKind44
 /INDEX = Index1(10)
 /NULL = KEEP.

If you want to keep your Id (your variable 'Respondent_Serial') then you
could use the following VARSTOCASES command:

VARSTOCASES /ID = id
 /MAKE trans1 FROM AlterKind1 AlterKind21 AlterKind22 AlterKind31
AlterKind32
  AlterKind33 AlterKind41 AlterKind42 AlterKind43 AlterKind44
 /INDEX = Index1(10)
 /KEEP =  Respondent_Serial
 /NULL = KEEP.

Hope this helps, Christian


-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]]Im Auftrag von
Balmer Thomas
Gesendet: Dienstag, 12. August 2008 13:55
An: [hidden email]
Betreff: AW: Display Values in different variables


Hi Christian

Thanks, I tried, but it didn't run. I just replaced the variable ID of your
example with my serial number which is Respondent_Serial (twice within the
VARSTOCASES Command), then started with VARSTOCASES with my original
dataset.
I'v got this warning:
Unterbefehl Respondent_Serial nicht erkannt.
Dieser Befehl wird nicht ausgeführt.

So, ID isn't a Variable, but a subcommand?



-----Ursprüngliche Nachricht-----
Von: la volta statistics [mailto:[hidden email]]
Gesendet: Dienstag, 12. August 2008 12:43
An: Balmer Thomas; [hidden email]
Betreff: AW: Display Values in different variables

Hi Thomas

Use the command VARSTOCASES to get all the ages into one variable.
I made you an example (see below). Ignore the warnings when the dataset is
created.

Hope this helps, Christian

*******************************
la volta statistics
Christian Schmidhauser, Dr.phil.II
Weinbergstrasse 108
CH-8006 Zürich
Tel: +41 (043) 233 98 01
Fax: +41 (043) 233 98 02
email: mailto:[hidden email]
internet: http://www.lavolta.ch/



* Start example.

New File.
DATASET CLOSE ALL.
DATA LIST list   /ID
                        AlterKind1
                        AlterKind21  AlterKind22
                        AlterKind31  AlterKind32 AlterKind33
                        AlterKind41  AlterKind42 AlterKind43 AlterKind44 .
BEGIN DATA
1  3
2  . 4 5
3  . . . 6 7 8
4  . . . . . . 9 10 11 12
5  4
6  . 5 6
7  . . . 7 8 9
8  . . . . . . 10 11 12 13
5  5
6  . 6 7
7  . . . 8 9 10
8  . . . . . . 11 12 13 14
9  7
10  . 7 8
11  . . . 10 11 12
12  . . . . . . 13 15 17 18
END DATA.

*Ignore the warnings.

VARSTOCASES /ID = id1
 /MAKE Age FROM AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32
  AlterKind33 AlterKind41 AlterKind42 AlterKind43 AlterKind44
 /INDEX = Index1(10)
 /KEEP =  ID
 /NULL = KEEP.

Select if (not missing(age)).

DATASET DECLARE Dataset2.
AGGREGATE
  /OUTFILE='Dataset2'
  /BREAK=Age
  /n_Counts=N.

DATASET ACTIVATE Dataset2.

Var Label n_counts 'Anzahl Kinder'
         /Age 'Alter (Jahre)'.

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Age n_Counts MISSING=
  LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: Age=col(source(s), name("Age"), unit.category())
 DATA: n_Counts=col(source(s), name("n_Counts"))
 GUIDE: axis(dim(1), label("Alter (Jahre)"))
 GUIDE: axis(dim(2), label("Anzahl Kinder"))
 SCALE: cat(dim(1))
 SCALE: linear(dim(2), include(0))
 ELEMENT: point(position(Age*n_Counts))
END GPL.

* End example.

-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]]Im Auftrag von
Balmer Thomas
Gesendet: Dienstag, 12. August 2008 11:51
An: [hidden email]
Betreff: Display Values in different variables


Hi there!



I have a dataset, in which the age of the children of families are
values in different variables: it has been the result of my rather
complicated solution in mrInterview to offer to the respondents the
possibility to answer according to the number of their children.



Therefore AlterKind1 contains the age of the child in the case, the
family has just one child, AlterKind21 and AlterKind22 contain the age
of the two children in the case, a family has two children etc...

AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32 AlterKind33
AlterKind41 AlterKind42 AlterKind43 AlterKind44



Now I'd like to display the frequencies of the ages (1 till 18) of all
children for all of the cases (y-axis number, x-axis age 1 to 18), but I
can't figure out how to do this with SPSS 16.0.



Thanks for your help.

Thomas



=======
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Tom
Reply | Threaded
Open this post in threaded view
|

AW: Display Values in different variables

Tom
Thanks a lot, Christian,

it works fine, now!

Thomas

______________________________



Thomas Balmer
Wissenschaftlicher Mitarbeiter
PHBern
Institut für Weiterbildung
Weltistrasse 40
CH-3006 Bern
T +41 31 309 27 36
F +41 31 309 27 99
[hidden email]

weiterbildung.phbern.ch


-----Ursprüngliche Nachricht-----
Von: la volta statistics [mailto:[hidden email]]
Gesendet: Dienstag, 12. August 2008 14:13
An: Balmer Thomas; [hidden email]
Betreff: AW: Display Values in different variables

For the purpose to make just the chart you can use the following VARSTOCASES command:

VARSTOCASES
 /MAKE Age FROM AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32
  AlterKind33 AlterKind41 AlterKind42 AlterKind43 AlterKind44
 /INDEX = Index1(10)
 /NULL = KEEP.

If you want to keep your Id (your variable 'Respondent_Serial') then you could use the following VARSTOCASES command:

VARSTOCASES /ID = id
 /MAKE trans1 FROM AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32
  AlterKind33 AlterKind41 AlterKind42 AlterKind43 AlterKind44
 /INDEX = Index1(10)
 /KEEP =  Respondent_Serial
 /NULL = KEEP.

Hope this helps, Christian


-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]]Im Auftrag von
Balmer Thomas
Gesendet: Dienstag, 12. August 2008 13:55
An: [hidden email]
Betreff: AW: Display Values in different variables


Hi Christian

Thanks, I tried, but it didn't run. I just replaced the variable ID of your example with my serial number which is Respondent_Serial (twice within the VARSTOCASES Command), then started with VARSTOCASES with my original dataset.
I'v got this warning:
Unterbefehl Respondent_Serial nicht erkannt.
Dieser Befehl wird nicht ausgeführt.

So, ID isn't a Variable, but a subcommand?



-----Ursprüngliche Nachricht-----
Von: la volta statistics [mailto:[hidden email]]
Gesendet: Dienstag, 12. August 2008 12:43
An: Balmer Thomas; [hidden email]
Betreff: AW: Display Values in different variables

Hi Thomas

Use the command VARSTOCASES to get all the ages into one variable.
I made you an example (see below). Ignore the warnings when the dataset is created.

Hope this helps, Christian

*******************************
la volta statistics
Christian Schmidhauser, Dr.phil.II
Weinbergstrasse 108
CH-8006 Zürich
Tel: +41 (043) 233 98 01
Fax: +41 (043) 233 98 02
email: mailto:[hidden email]
internet: http://www.lavolta.ch/



* Start example.

New File.
DATASET CLOSE ALL.
DATA LIST list   /ID
                        AlterKind1
                        AlterKind21  AlterKind22
                        AlterKind31  AlterKind32 AlterKind33
                        AlterKind41  AlterKind42 AlterKind43 AlterKind44 .
BEGIN DATA
1  3
2  . 4 5
3  . . . 6 7 8
4  . . . . . . 9 10 11 12
5  4
6  . 5 6
7  . . . 7 8 9
8  . . . . . . 10 11 12 13
5  5
6  . 6 7
7  . . . 8 9 10
8  . . . . . . 11 12 13 14
9  7
10  . 7 8
11  . . . 10 11 12
12  . . . . . . 13 15 17 18
END DATA.

*Ignore the warnings.

VARSTOCASES /ID = id1
 /MAKE Age FROM AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32
  AlterKind33 AlterKind41 AlterKind42 AlterKind43 AlterKind44
 /INDEX = Index1(10)
 /KEEP =  ID
 /NULL = KEEP.

Select if (not missing(age)).

DATASET DECLARE Dataset2.
AGGREGATE
  /OUTFILE='Dataset2'
  /BREAK=Age
  /n_Counts=N.

DATASET ACTIVATE Dataset2.

Var Label n_counts 'Anzahl Kinder'
         /Age 'Alter (Jahre)'.

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Age n_Counts MISSING=
  LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: Age=col(source(s), name("Age"), unit.category())
 DATA: n_Counts=col(source(s), name("n_Counts"))
 GUIDE: axis(dim(1), label("Alter (Jahre)"))
 GUIDE: axis(dim(2), label("Anzahl Kinder"))
 SCALE: cat(dim(1))
 SCALE: linear(dim(2), include(0))
 ELEMENT: point(position(Age*n_Counts))
END GPL.

* End example.

-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]]Im Auftrag von
Balmer Thomas
Gesendet: Dienstag, 12. August 2008 11:51
An: [hidden email]
Betreff: Display Values in different variables


Hi there!



I have a dataset, in which the age of the children of families are
values in different variables: it has been the result of my rather
complicated solution in mrInterview to offer to the respondents the
possibility to answer according to the number of their children.



Therefore AlterKind1 contains the age of the child in the case, the
family has just one child, AlterKind21 and AlterKind22 contain the age
of the two children in the case, a family has two children etc...

AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32 AlterKind33
AlterKind41 AlterKind42 AlterKind43 AlterKind44



Now I'd like to display the frequencies of the ages (1 till 18) of all
children for all of the cases (y-axis number, x-axis age 1 to 18), but I
can't figure out how to do this with SPSS 16.0.



Thanks for your help.

Thomas



=======
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD