Variables with 2 dataset

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

Variables with 2 dataset

behnaz shirazi-2
Hello Dear All,

I had a question! I want to get some variables from one dataset and some
other variables from the other dataset and at the end I put all of these
variables in a single spss table.I wonder is it possible?!
If so , how can I do this.

If you can guide me you helped me a lot.


Thank you
Behnaz

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
Reply | Threaded
Open this post in threaded view
|

Re: Variables with 2 dataset

Hector Maletta
        Behnaz,
        SPSS datasets refer to certain UNITS or CASES. For your variables to
be put in the same dataset, they should refer to the same units, for example
the same persons. May be you have their AGE in one data set, and their
INCOME in another, and you want both age and income in the same dataset.
        If that is your problem, then you may have two situations:
        1. Both datasets include EXACTLY the same cases, in EXACTLY the same
order. The first case in one dataset is also the first case in the other,
the second is the second, and so on. If that is the case, you may use the
MATCH FILES command (or the menu DATA-MERGE FILES-ADD VARIABLES) without
specifying an ID variable.
        2. Both datasets include the same cases, but not necessarily in the
same order, and they may include also other cases. If so, you need both
datasets to have a common variable to serve as an ID. An ID variable has a
unique value for each case, and this value is the same in both datasets.
Then you may apply the MATCH FILES command, or the same menu options
mentioned before, but using the ID variable to match each case in one
dataset with the corresponding case in the other one. However, both datasets
should previously be SORTED by ID. Example:

        GET FILE 'DATASET A.SAV'.
        SORT CASES BY ID.
        SAVE FILE 'DATASET A.SAV'.

        GET FILE 'DATASET B.SAV'.
        SORT CASES BY ID.
        SAVE FILE 'DATASET B.SAV'.

        MATCH FILES /FILE 'DATASET A.SAV'/FILE 'DATASET B.SAV'/BY ID.
        SAVE OUTFILE 'MERGED.SAV'.

        Hector

        -----Mensaje original-----
De: SPSSX(r) Discussion [mailto:[hidden email]] En nombre de
behnaz shirazi
Enviado el: 25 February 2007 19:49
Para: [hidden email]
Asunto: Variables with 2 dataset

        Hello Dear All,

        I had a question! I want to get some variables from one dataset and
some
        other variables from the other dataset and at the end I put all of
these
        variables in a single spss table.I wonder is it possible?!
        If so , how can I do this.

        If you can guide me you helped me a lot.


        Thank you
        Behnaz

        _________________________________________________________________
        FREE pop-up blocking with the new MSN Toolbar - get it now!
        http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
Reply | Threaded
Open this post in threaded view
|

Re: Variables with 2 dataset

behnaz shirazi-2
Thank you Hector
But my case is diferent.I have two agencies for example A and B which the
number of variables can be different in each dataset and for example I want
to compare percent of sex in Agency A with Agency B.At the moment I run
different syntax code and I get different output and then I put values in my
powerpoint graph.I want to automate this process and for this ,frist I have
to catch my variables from these two dataset in one dataset or in on single
spss table.After that I can use it in access and have charts
easily.(Automatic)
But I don't know is it possible to prepare such dataset using two other
dataset?

I wonder if you have any experience like this?

Thank you
Behnaz Shirazi


>From: Hector Maletta <[hidden email]>
>Reply-To: Hector Maletta <[hidden email]>
>To: [hidden email]
>Subject: Re: Variables with 2 dataset
>Date: Sun, 25 Feb 2007 20:07:10 +0100
>
>         Behnaz,
>         SPSS datasets refer to certain UNITS or CASES. For your variables
>to
>be put in the same dataset, they should refer to the same units, for
>example
>the same persons. May be you have their AGE in one data set, and their
>INCOME in another, and you want both age and income in the same dataset.
>         If that is your problem, then you may have two situations:
>         1. Both datasets include EXACTLY the same cases, in EXACTLY the
>same
>order. The first case in one dataset is also the first case in the other,
>the second is the second, and so on. If that is the case, you may use the
>MATCH FILES command (or the menu DATA-MERGE FILES-ADD VARIABLES) without
>specifying an ID variable.
>         2. Both datasets include the same cases, but not necessarily in
>the
>same order, and they may include also other cases. If so, you need both
>datasets to have a common variable to serve as an ID. An ID variable has a
>unique value for each case, and this value is the same in both datasets.
>Then you may apply the MATCH FILES command, or the same menu options
>mentioned before, but using the ID variable to match each case in one
>dataset with the corresponding case in the other one. However, both
>datasets
>should previously be SORTED by ID. Example:
>
>         GET FILE 'DATASET A.SAV'.
>         SORT CASES BY ID.
>         SAVE FILE 'DATASET A.SAV'.
>
>         GET FILE 'DATASET B.SAV'.
>         SORT CASES BY ID.
>         SAVE FILE 'DATASET B.SAV'.
>
>         MATCH FILES /FILE 'DATASET A.SAV'/FILE 'DATASET B.SAV'/BY ID.
>         SAVE OUTFILE 'MERGED.SAV'.
>
>         Hector
>
>         -----Mensaje original-----
>De: SPSSX(r) Discussion [mailto:[hidden email]] En nombre de
>behnaz shirazi
>Enviado el: 25 February 2007 19:49
>Para: [hidden email]
>Asunto: Variables with 2 dataset
>
>         Hello Dear All,
>
>         I had a question! I want to get some variables from one dataset
>and
>some
>         other variables from the other dataset and at the end I put all of
>these
>         variables in a single spss table.I wonder is it possible?!
>         If so , how can I do this.
>
>         If you can guide me you helped me a lot.
>
>
>         Thank you
>         Behnaz
>
>         _________________________________________________________________
>         FREE pop-up blocking with the new MSN Toolbar - get it now!
>         http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Reply | Threaded
Open this post in threaded view
|

Re: Variables with 2 dataset

Melissa Ives
In reply to this post by behnaz shirazi-2
Behnaz,

Use Add files to concatenate datasets vertically (add new records) and
Match files to concatenate horizontally (add new variables.  Use the
/IN= subcommand to identify the agency (you can recode this later to
whatever you want if 1/0 variables are uncomfortable).  Using the /BY=ID
subcommand will sort them by id, but is not necessary.

ADD FILES
        /FILE 'DATASET A.SAV'/IN=Agency
        /FILE 'DATASET B.SAV'.
SAVE OUTFILE 'MERGED.SAV'.

Var labels Agency 1 'Agency A' 0 'Agency B'.

Then run your comparisons by agency.

Melissa
The bubbling brook would lose its song if you removed the rocks.


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
behnaz shirazi
Sent: Monday, February 26, 2007 10:10 AM
To: [hidden email]
Subject: Re: [SPSSX-L] Variables with 2 dataset

Thank you Hector
But my case is diferent.I have two agencies for example A and B which
the number of variables can be different in each dataset and for example
I want to compare percent of sex in Agency A with Agency B.At the moment
I run different syntax code and I get different output and then I put
values in my powerpoint graph.I want to automate this process and for
this ,frist I have to catch my variables from these two dataset in one
dataset or in on single spss table.After that I can use it in access and
have charts
easily.(Automatic)
But I don't know is it possible to prepare such dataset using two other
dataset?

I wonder if you have any experience like this?

Thank you
Behnaz Shirazi


>From: Hector Maletta <[hidden email]>
>Reply-To: Hector Maletta <[hidden email]>
>To: [hidden email]
>Subject: Re: Variables with 2 dataset
>Date: Sun, 25 Feb 2007 20:07:10 +0100
>
>         Behnaz,
>         SPSS datasets refer to certain UNITS or CASES. For your
>variables to be put in the same dataset, they should refer to the same
>units, for example the same persons. May be you have their AGE in one
>data set, and their INCOME in another, and you want both age and income

>in the same dataset.
>         If that is your problem, then you may have two situations:
>         1. Both datasets include EXACTLY the same cases, in EXACTLY
>the same order. The first case in one dataset is also the first case in

>the other, the second is the second, and so on. If that is the case,
>you may use the MATCH FILES command (or the menu DATA-MERGE FILES-ADD
>VARIABLES) without specifying an ID variable.
>         2. Both datasets include the same cases, but not necessarily
>in the same order, and they may include also other cases. If so, you
>need both datasets to have a common variable to serve as an ID. An ID
>variable has a unique value for each case, and this value is the same
>in both datasets.
>Then you may apply the MATCH FILES command, or the same menu options
>mentioned before, but using the ID variable to match each case in one
>dataset with the corresponding case in the other one. However, both
>datasets should previously be SORTED by ID. Example:
>
>         GET FILE 'DATASET A.SAV'.
>         SORT CASES BY ID.
>         SAVE FILE 'DATASET A.SAV'.
>
>         GET FILE 'DATASET B.SAV'.
>         SORT CASES BY ID.
>         SAVE FILE 'DATASET B.SAV'.
>
>         MATCH FILES /FILE 'DATASET A.SAV'/FILE 'DATASET B.SAV'/BY ID.
>         SAVE OUTFILE 'MERGED.SAV'.
>
>         Hector
>
>         -----Mensaje original-----
>De: SPSSX(r) Discussion [mailto:[hidden email]] En nombre de
>behnaz shirazi Enviado el: 25 February 2007 19:49
>Para: [hidden email]
>Asunto: Variables with 2 dataset
>
>         Hello Dear All,
>
>         I had a question! I want to get some variables from one
>dataset and some
>         other variables from the other dataset and at the end I put
>all of these
>         variables in a single spss table.I wonder is it possible?!
>         If so , how can I do this.
>
>         If you can guide me you helped me a lot.
>
>
>         Thank you
>         Behnaz
>
>
_________________________________________________________________
>         FREE pop-up blocking with the new MSN Toolbar - get it now!
>         http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.
Reply | Threaded
Open this post in threaded view
|

Re: Variables with 2 dataset

Hector Maletta
In reply to this post by behnaz shirazi-2
        Behnaz, I suspect when you say " the number of variables can be
different in each dataset" you mean "the number of CASES can be different"
(for instance the number of persons in each agency). I suspect one of your
datasets contains people from agency A, characterized by several variables
including the agency to which they belong (A) and their sex, and another
similar dataset containing people from agency B.
        To put both in a single dataset you should use ADD FILES. Then you
may obtain a crosstabulation giving you the gender distribution by agency:

        ADD FILES /FILE 'AGENCY A.SAV'/FILE 'AGENCY B.SAV'.
        SAVE OUTFILE 'BOTH AGENCIES.SAV'.
        GET FILE 'BOTH AGENCIES.SAV'.
        CROSSTABS SEX BY AGENCY.

        Hector

        -----Mensaje original-----
De: behnaz shirazi [mailto:[hidden email]]
Enviado el: 26 February 2007 17:10
Para: [hidden email]; [hidden email]
Asunto: Re: Variables with 2 dataset

        Thank you Hector
        But my case is diferent.I have two agencies for example A and B
which the
        number of variables can be different in each dataset and for example
I want
        to compare percent of sex in Agency A with Agency B.At the moment I
run
        different syntax code and I get different output and then I put
values in my
        powerpoint graph.I want to automate this process and for this ,frist
I have
        to catch my variables from these two dataset in one dataset or in on
single
        spss table.After that I can use it in access and have charts
        easily.(Automatic)
        But I don't know is it possible to prepare such dataset using two
other
        dataset?

        I wonder if you have any experience like this?

        Thank you
        Behnaz Shirazi


        >From: Hector Maletta <[hidden email]>
        >Reply-To: Hector Maletta <[hidden email]>
        >To: [hidden email]
        >Subject: Re: Variables with 2 dataset
        >Date: Sun, 25 Feb 2007 20:07:10 +0100
        >
        >         Behnaz,
        >         SPSS datasets refer to certain UNITS or CASES. For your
variables
        >to
        >be put in the same dataset, they should refer to the same units,
for
        >example
        >the same persons. May be you have their AGE in one data set, and
their
        >INCOME in another, and you want both age and income in the same
dataset.
        >         If that is your problem, then you may have two situations:
        >         1. Both datasets include EXACTLY the same cases, in
EXACTLY the
        >same
        >order. The first case in one dataset is also the first case in the
other,
        >the second is the second, and so on. If that is the case, you may
use the
        >MATCH FILES command (or the menu DATA-MERGE FILES-ADD VARIABLES)
without
        >specifying an ID variable.
        >         2. Both datasets include the same cases, but not
necessarily in
        >the
        >same order, and they may include also other cases. If so, you need
both
        >datasets to have a common variable to serve as an ID. An ID
variable has a
        >unique value for each case, and this value is the same in both
datasets.
        >Then you may apply the MATCH FILES command, or the same menu
options
        >mentioned before, but using the ID variable to match each case in
one
        >dataset with the corresponding case in the other one. However, both

        >datasets
        >should previously be SORTED by ID. Example:
        >
        >         GET FILE 'DATASET A.SAV'.
        >         SORT CASES BY ID.
        >         SAVE FILE 'DATASET A.SAV'.
        >
        >         GET FILE 'DATASET B.SAV'.
        >         SORT CASES BY ID.
        >         SAVE FILE 'DATASET B.SAV'.
        >
        >         MATCH FILES /FILE 'DATASET A.SAV'/FILE 'DATASET B.SAV'/BY
ID.
        >         SAVE OUTFILE 'MERGED.SAV'.
        >
        >         Hector
        >
        >         -----Mensaje original-----
        >De: SPSSX(r) Discussion [mailto:[hidden email]] En nombre
de
        >behnaz shirazi
        >Enviado el: 25 February 2007 19:49
        >Para: [hidden email]
        >Asunto: Variables with 2 dataset
        >
        >         Hello Dear All,
        >
        >         I had a question! I want to get some variables from one
dataset
        >and
        >some
        >         other variables from the other dataset and at the end I
put all of
        >these
        >         variables in a single spss table.I wonder is it possible?!
        >         If so , how can I do this.
        >
        >         If you can guide me you helped me a lot.
        >
        >
        >         Thank you
        >         Behnaz
        >
        >
_________________________________________________________________
        >         FREE pop-up blocking with the new MSN Toolbar - get it
now!
        >
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

        _________________________________________________________________
        Express yourself instantly with MSN Messenger! Download today it's
FREE!
        http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Reply | Threaded
Open this post in threaded view
|

Re: Variables with 2 dataset

behnaz shirazi-2
In reply to this post by Melissa Ives
Thank you Melissa and Hector,

I guess I couldn't expalin very well the situation.OK I will start again:

I have two dataset : Agency A , Agency B
They have the same number of variables with the same name.For example:

Agency A                           Agency B
Agency Name                     Agency Name
Sex                                   Sex
Date                                 Date
....                                     ....

Now I want to catch sex from Agency A and sex from Agency B and compare the
percentage
of males and females within each agency.

AgencyA                                         AgencyB
Male                       80%  Male                         30%
Feamle                   20%    Female                      70%

Now I am running code separately for each agency.I wonder can I catch
desirable variables like Sex
from each agency and put them in one single spss table?


I hope this time I could explain better.

Thanks for your help
Behnaz

>From: Melissa Ives <[hidden email]>
>Reply-To: Melissa Ives <[hidden email]>
>To: [hidden email]
>Subject: Re: Variables with 2 dataset
>Date: Mon, 26 Feb 2007 10:54:45 -0600
>
>Behnaz,
>
>Use Add files to concatenate datasets vertically (add new records) and
>Match files to concatenate horizontally (add new variables.  Use the
>/IN= subcommand to identify the agency (you can recode this later to
>whatever you want if 1/0 variables are uncomfortable).  Using the /BY=ID
>subcommand will sort them by id, but is not necessary.
>
>ADD FILES
>         /FILE 'DATASET A.SAV'/IN=Agency
>         /FILE 'DATASET B.SAV'.
>SAVE OUTFILE 'MERGED.SAV'.
>
>Var labels Agency 1 'Agency A' 0 'Agency B'.
>
>Then run your comparisons by agency.
>
>Melissa
>The bubbling brook would lose its song if you removed the rocks.
>
>
>-----Original Message-----
>From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
>behnaz shirazi
>Sent: Monday, February 26, 2007 10:10 AM
>To: [hidden email]
>Subject: Re: [SPSSX-L] Variables with 2 dataset
>
>Thank you Hector
>But my case is diferent.I have two agencies for example A and B which
>the number of variables can be different in each dataset and for example
>I want to compare percent of sex in Agency A with Agency B.At the moment
>I run different syntax code and I get different output and then I put
>values in my powerpoint graph.I want to automate this process and for
>this ,frist I have to catch my variables from these two dataset in one
>dataset or in on single spss table.After that I can use it in access and
>have charts
>easily.(Automatic)
>But I don't know is it possible to prepare such dataset using two other
>dataset?
>
>I wonder if you have any experience like this?
>
>Thank you
>Behnaz Shirazi
>
>
> >From: Hector Maletta <[hidden email]>
> >Reply-To: Hector Maletta <[hidden email]>
> >To: [hidden email]
> >Subject: Re: Variables with 2 dataset
> >Date: Sun, 25 Feb 2007 20:07:10 +0100
> >
> >         Behnaz,
> >         SPSS datasets refer to certain UNITS or CASES. For your
> >variables to be put in the same dataset, they should refer to the same
> >units, for example the same persons. May be you have their AGE in one
> >data set, and their INCOME in another, and you want both age and income
>
> >in the same dataset.
> >         If that is your problem, then you may have two situations:
> >         1. Both datasets include EXACTLY the same cases, in EXACTLY
> >the same order. The first case in one dataset is also the first case in
>
> >the other, the second is the second, and so on. If that is the case,
> >you may use the MATCH FILES command (or the menu DATA-MERGE FILES-ADD
> >VARIABLES) without specifying an ID variable.
> >         2. Both datasets include the same cases, but not necessarily
> >in the same order, and they may include also other cases. If so, you
> >need both datasets to have a common variable to serve as an ID. An ID
> >variable has a unique value for each case, and this value is the same
> >in both datasets.
> >Then you may apply the MATCH FILES command, or the same menu options
> >mentioned before, but using the ID variable to match each case in one
> >dataset with the corresponding case in the other one. However, both
> >datasets should previously be SORTED by ID. Example:
> >
> >         GET FILE 'DATASET A.SAV'.
> >         SORT CASES BY ID.
> >         SAVE FILE 'DATASET A.SAV'.
> >
> >         GET FILE 'DATASET B.SAV'.
> >         SORT CASES BY ID.
> >         SAVE FILE 'DATASET B.SAV'.
> >
> >         MATCH FILES /FILE 'DATASET A.SAV'/FILE 'DATASET B.SAV'/BY ID.
> >         SAVE OUTFILE 'MERGED.SAV'.
> >
> >         Hector
> >
> >         -----Mensaje original-----
> >De: SPSSX(r) Discussion [mailto:[hidden email]] En nombre de
> >behnaz shirazi Enviado el: 25 February 2007 19:49
> >Para: [hidden email]
> >Asunto: Variables with 2 dataset
> >
> >         Hello Dear All,
> >
> >         I had a question! I want to get some variables from one
> >dataset and some
> >         other variables from the other dataset and at the end I put
> >all of these
> >         variables in a single spss table.I wonder is it possible?!
> >         If so , how can I do this.
> >
> >         If you can guide me you helped me a lot.
> >
> >
> >         Thank you
> >         Behnaz
> >
> >
>_________________________________________________________________
> >         FREE pop-up blocking with the new MSN Toolbar - get it now!
> >         http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>
>_________________________________________________________________
>Express yourself instantly with MSN Messenger! Download today it's FREE!
>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
>PRIVILEGED AND CONFIDENTIAL INFORMATION
>This transmittal and any attachments may contain PRIVILEGED AND
>CONFIDENTIAL information and is intended only for the use of the
>addressee. If you are not the designated recipient, or an employee
>or agent authorized to deliver such transmittals to the designated
>recipient, you are hereby notified that any dissemination,
>copying or publication of this transmittal is strictly prohibited. If
>you have received this transmittal in error, please notify us
>immediately by replying to the sender and delete this copy from your
>system. You may also call us at (309) 827-6026 for assistance.

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
Reply | Threaded
Open this post in threaded view
|

Re: Variables with 2 dataset

Melissa Ives
In reply to this post by behnaz shirazi-2
The add files command will 'catch' all of the variables from both files.
To compare the 2 agencies, the easiest thing would be to use.

Cro tab=sex by agency/cells=col/stats=chisq.

You will get a table something like this.
                AgencyA   AgencyB       Total
Male          80%       30%       55%
Female    20%       70%   45%
Total    100%        100%        100%

If you ONLY want Agency and sex in your dataset (which seems to me to be
a lot of unnecessary work, but you have your own reasons), AND assuming
you already have a variable for agency in each dataset, then in version
14:

Get file='agencya.sav'/keep=agency sex.
Dataset name agencya.
Get file='agencyb.sav'/keep=agency sex.
Dataset name agencyb.
Add files
        file=agencya/
        file=agencyb.

Cro tab=sex by agency/cells=count col/stats=chisq.

In earlier versions, you would need to get the subsetted file, save it,
get the next subsetted file, then use add files and run your crosstabs.
The key is to identify your agency in the file either before merging (as
in the following example) or during the the merge using the /IN=
command.

Melissa
The bubbling brook would lose its song if you removed the rocks.


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
behnaz shirazi
Sent: Monday, February 26, 2007 3:05 PM
To: [hidden email]
Subject: Re: [SPSSX-L] Variables with 2 dataset

Thank you Melissa and Hector,

I guess I couldn't expalin very well the situation.OK I will start
again:

I have two dataset : Agency A , Agency B They have the same number of
variables with the same name.For example:

Agency A                           Agency B
Agency Name                     Agency Name
Sex                                   Sex
Date                                 Date
....                                     ....

Now I want to catch sex from Agency A and sex from Agency B and compare
the percentage of males and females within each agency.

AgencyA                                         AgencyB
Male                       80%  Male                         30%
Feamle                   20%    Female                      70%

Now I am running code separately for each agency.I wonder can I catch
desirable variables like Sex from each agency and put them in one single
spss table?


I hope this time I could explain better.

Thanks for your help
Behnaz

>From: Melissa Ives <[hidden email]>
>Reply-To: Melissa Ives <[hidden email]>
>To: [hidden email]
>Subject: Re: Variables with 2 dataset
>Date: Mon, 26 Feb 2007 10:54:45 -0600
>
>Behnaz,
>
>Use Add files to concatenate datasets vertically (add new records) and
>Match files to concatenate horizontally (add new variables.  Use the
>/IN= subcommand to identify the agency (you can recode this later to
>whatever you want if 1/0 variables are uncomfortable).  Using the
>/BY=ID subcommand will sort them by id, but is not necessary.
>
>ADD FILES
>         /FILE 'DATASET A.SAV'/IN=Agency
>         /FILE 'DATASET B.SAV'.
>SAVE OUTFILE 'MERGED.SAV'.
>
>Var labels Agency 1 'Agency A' 0 'Agency B'.
>
>Then run your comparisons by agency.
>
>Melissa
>The bubbling brook would lose its song if you removed the rocks.
>
>
>-----Original Message-----
>From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf
>Of behnaz shirazi
>Sent: Monday, February 26, 2007 10:10 AM
>To: [hidden email]
>Subject: Re: [SPSSX-L] Variables with 2 dataset
>
>Thank you Hector
>But my case is diferent.I have two agencies for example A and B which
>the number of variables can be different in each dataset and for
>example I want to compare percent of sex in Agency A with Agency B.At
>the moment I run different syntax code and I get different output and
>then I put values in my powerpoint graph.I want to automate this
>process and for this ,frist I have to catch my variables from these two

>dataset in one dataset or in on single spss table.After that I can use
>it in access and have charts
>easily.(Automatic)
>But I don't know is it possible to prepare such dataset using two other

>dataset?
>
>I wonder if you have any experience like this?
>
>Thank you
>Behnaz Shirazi
>
>
> >From: Hector Maletta <[hidden email]>
> >Reply-To: Hector Maletta <[hidden email]>
> >To: [hidden email]
> >Subject: Re: Variables with 2 dataset
> >Date: Sun, 25 Feb 2007 20:07:10 +0100
> >
> >         Behnaz,
> >         SPSS datasets refer to certain UNITS or CASES. For your
> >variables to be put in the same dataset, they should refer to the
> >same units, for example the same persons. May be you have their AGE
> >in one data set, and their INCOME in another, and you want both age
> >and income
>
> >in the same dataset.
> >         If that is your problem, then you may have two situations:
> >         1. Both datasets include EXACTLY the same cases, in EXACTLY
> >the same order. The first case in one dataset is also the first case
> >in
>
> >the other, the second is the second, and so on. If that is the case,
> >you may use the MATCH FILES command (or the menu DATA-MERGE FILES-ADD
> >VARIABLES) without specifying an ID variable.
> >         2. Both datasets include the same cases, but not necessarily

> >in the same order, and they may include also other cases. If so, you
> >need both datasets to have a common variable to serve as an ID. An ID

> >variable has a unique value for each case, and this value is the same

> >in both datasets.
> >Then you may apply the MATCH FILES command, or the same menu options
> >mentioned before, but using the ID variable to match each case in one

> >dataset with the corresponding case in the other one. However, both
> >datasets should previously be SORTED by ID. Example:
> >
> >         GET FILE 'DATASET A.SAV'.
> >         SORT CASES BY ID.
> >         SAVE FILE 'DATASET A.SAV'.
> >
> >         GET FILE 'DATASET B.SAV'.
> >         SORT CASES BY ID.
> >         SAVE FILE 'DATASET B.SAV'.
> >
> >         MATCH FILES /FILE 'DATASET A.SAV'/FILE 'DATASET B.SAV'/BY
ID.

> >         SAVE OUTFILE 'MERGED.SAV'.
> >
> >         Hector
> >
> >         -----Mensaje original-----
> >De: SPSSX(r) Discussion [mailto:[hidden email]] En nombre
> >de behnaz shirazi Enviado el: 25 February 2007 19:49
> >Para: [hidden email]
> >Asunto: Variables with 2 dataset
> >
> >         Hello Dear All,
> >
> >         I had a question! I want to get some variables from one
> >dataset and some
> >         other variables from the other dataset and at the end I put
> >all of these
> >         variables in a single spss table.I wonder is it possible?!
> >         If so , how can I do this.
> >
> >         If you can guide me you helped me a lot.
> >
> >
> >         Thank you
> >         Behnaz
> >
> >
>_________________________________________________________________
> >         FREE pop-up blocking with the new MSN Toolbar - get it now!
> >
> > http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>
>_________________________________________________________________
>Express yourself instantly with MSN Messenger! Download today it's
FREE!

>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
>PRIVILEGED AND CONFIDENTIAL INFORMATION This transmittal and any
>attachments may contain PRIVILEGED AND CONFIDENTIAL information and is
>intended only for the use of the addressee. If you are not the
>designated recipient, or an employee or agent authorized to deliver
>such transmittals to the designated recipient, you are hereby notified
>that any dissemination, copying or publication of this transmittal is
>strictly prohibited. If you have received this transmittal in error,
>please notify us immediately by replying to the sender and delete this
>copy from your system. You may also call us at (309) 827-6026 for
>assistance.

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.
Reply | Threaded
Open this post in threaded view
|

Re: Variables with 2 dataset

Hector Maletta
In reply to this post by behnaz shirazi-2
        Again, ADD FILES would do it.

        Hector

        -----Mensaje original-----
De: SPSSX(r) Discussion [mailto:[hidden email]] En nombre de
behnaz shirazi
Enviado el: 26 February 2007 22:05
Para: [hidden email]
Asunto: Re: Variables with 2 dataset

        Thank you Melissa and Hector,

        I guess I couldn't expalin very well the situation.OK I will start
again:

        I have two dataset : Agency A , Agency B
        They have the same number of variables with the same name.For
example:

        Agency A                           Agency B
        Agency Name                     Agency Name
        Sex                                   Sex
        Date                                 Date
        ....                                     ....

        Now I want to catch sex from Agency A and sex from Agency B and
compare the
        percentage
        of males and females within each agency.

        AgencyA                                         AgencyB
        Male                       80%  Male                         30%
        Feamle                   20%    Female                      70%

        Now I am running code separately for each agency.I wonder can I
catch
        desirable variables like Sex
        from each agency and put them in one single spss table?


        I hope this time I could explain better.

        Thanks for your help
        Behnaz

        >From: Melissa Ives <[hidden email]>
        >Reply-To: Melissa Ives <[hidden email]>
        >To: [hidden email]
        >Subject: Re: Variables with 2 dataset
        >Date: Mon, 26 Feb 2007 10:54:45 -0600
        >
        >Behnaz,
        >
        >Use Add files to concatenate datasets vertically (add new records)
and
        >Match files to concatenate horizontally (add new variables.  Use
the
        >/IN= subcommand to identify the agency (you can recode this later
to
        >whatever you want if 1/0 variables are uncomfortable).  Using the
/BY=ID
        >subcommand will sort them by id, but is not necessary.
        >
        >ADD FILES
        >         /FILE 'DATASET A.SAV'/IN=Agency
        >         /FILE 'DATASET B.SAV'.
        >SAVE OUTFILE 'MERGED.SAV'.
        >
        >Var labels Agency 1 'Agency A' 0 'Agency B'.
        >
        >Then run your comparisons by agency.
        >
        >Melissa
        >The bubbling brook would lose its song if you removed the rocks.
        >
        >
        >-----Original Message-----
        >From: SPSSX(r) Discussion [mailto:[hidden email]] On
Behalf Of
        >behnaz shirazi
        >Sent: Monday, February 26, 2007 10:10 AM
        >To: [hidden email]
        >Subject: Re: [SPSSX-L] Variables with 2 dataset
        >
        >Thank you Hector
        >But my case is diferent.I have two agencies for example A and B
which
        >the number of variables can be different in each dataset and for
example
        >I want to compare percent of sex in Agency A with Agency B.At the
moment
        >I run different syntax code and I get different output and then I
put
        >values in my powerpoint graph.I want to automate this process and
for
        >this ,frist I have to catch my variables from these two dataset in
one
        >dataset or in on single spss table.After that I can use it in
access and
        >have charts
        >easily.(Automatic)
        >But I don't know is it possible to prepare such dataset using two
other
        >dataset?
        >
        >I wonder if you have any experience like this?
        >
        >Thank you
        >Behnaz Shirazi
        >
        >
        > >From: Hector Maletta <[hidden email]>
        > >Reply-To: Hector Maletta <[hidden email]>
        > >To: [hidden email]
        > >Subject: Re: Variables with 2 dataset
        > >Date: Sun, 25 Feb 2007 20:07:10 +0100
        > >
        > >         Behnaz,
        > >         SPSS datasets refer to certain UNITS or CASES. For your
        > >variables to be put in the same dataset, they should refer to the
same
        > >units, for example the same persons. May be you have their AGE in
one
        > >data set, and their INCOME in another, and you want both age and
income
        >
        > >in the same dataset.
        > >         If that is your problem, then you may have two
situations:
        > >         1. Both datasets include EXACTLY the same cases, in
EXACTLY
        > >the same order. The first case in one dataset is also the first
case in
        >
        > >the other, the second is the second, and so on. If that is the
case,
        > >you may use the MATCH FILES command (or the menu DATA-MERGE
FILES-ADD
        > >VARIABLES) without specifying an ID variable.
        > >         2. Both datasets include the same cases, but not
necessarily
        > >in the same order, and they may include also other cases. If so,
you
        > >need both datasets to have a common variable to serve as an ID.
An ID
        > >variable has a unique value for each case, and this value is the
same
        > >in both datasets.
        > >Then you may apply the MATCH FILES command, or the same menu
options
        > >mentioned before, but using the ID variable to match each case in
one
        > >dataset with the corresponding case in the other one. However,
both
        > >datasets should previously be SORTED by ID. Example:
        > >
        > >         GET FILE 'DATASET A.SAV'.
        > >         SORT CASES BY ID.
        > >         SAVE FILE 'DATASET A.SAV'.
        > >
        > >         GET FILE 'DATASET B.SAV'.
        > >         SORT CASES BY ID.
        > >         SAVE FILE 'DATASET B.SAV'.
        > >
        > >         MATCH FILES /FILE 'DATASET A.SAV'/FILE 'DATASET
B.SAV'/BY ID.
        > >         SAVE OUTFILE 'MERGED.SAV'.
        > >
        > >         Hector
        > >
        > >         -----Mensaje original-----
        > >De: SPSSX(r) Discussion [mailto:[hidden email]] En
nombre de
        > >behnaz shirazi Enviado el: 25 February 2007 19:49
        > >Para: [hidden email]
        > >Asunto: Variables with 2 dataset
        > >
        > >         Hello Dear All,
        > >
        > >         I had a question! I want to get some variables from one
        > >dataset and some
        > >         other variables from the other dataset and at the end I
put
        > >all of these
        > >         variables in a single spss table.I wonder is it
possible?!
        > >         If so , how can I do this.
        > >
        > >         If you can guide me you helped me a lot.
        > >
        > >
        > >         Thank you
        > >         Behnaz
        > >
        > >
        >_________________________________________________________________
        > >         FREE pop-up blocking with the new MSN Toolbar - get it
now!
        > >
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
        >
        >_________________________________________________________________
        >Express yourself instantly with MSN Messenger! Download today it's
FREE!
        >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
        >
        >
        >PRIVILEGED AND CONFIDENTIAL INFORMATION
        >This transmittal and any attachments may contain PRIVILEGED AND
        >CONFIDENTIAL information and is intended only for the use of the
        >addressee. If you are not the designated recipient, or an employee
        >or agent authorized to deliver such transmittals to the designated
        >recipient, you are hereby notified that any dissemination,
        >copying or publication of this transmittal is strictly prohibited.
If
        >you have received this transmittal in error, please notify us
        >immediately by replying to the sender and delete this copy from
your
        >system. You may also call us at (309) 827-6026 for assistance.

        _________________________________________________________________
        Don't just search. Find. Check out the new MSN Search!
        http://search.msn.click-url.com/go/onm00200636ave/direct/01/