data manipulation

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

data manipulation

Gary Stevens-2
I would like to grab one cell value and make it the value of every cell in
another column.


V1 V2 FacilityCounty
Reply | Threaded
Open this post in threaded view
|

Re: data manipulation

Melissa Ives
On what criteria will you 'grab one cell value'?


Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Gary Stevens
Sent: Thursday, May 24, 2007 9:17 AM
To: [hidden email]
Subject: [SPSSX-L] data manipulation

I would like to grab one cell value and make it the value of every cell
in another column.


V1 V2 FacilityCounty


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: data manipulation

Melissa Ives
In reply to this post by Gary Stevens-2
Gary,

I guess I am still not following you.  When you create variables, they
are usually in columns, not rows, so new variables would be associated
with the first variable in any given row.

It may be simplest to read in the data, then use a simple compute
statement such as:
        Compute FACID=123.
        save outfile='fac123.sav'/keep=FACID <the rest of the
variables>.
Where 123 is the facility number--that would need to change each time
you read in a new file.

If what you are saying is that you have multiple text files by facility
and each one has a single row with one variable in it, look at reading
in a nested datafile.

123
A B C 123 343
C B A 234 334

Melissa

-----Original Message-----
From: Gary Stevens [mailto:[hidden email]]
Sent: Thursday, May 24, 2007 9:59 AM
To: Melissa Ives
Subject: RE: Re: data manipulation

I am importing a text file and each file has the facility number in the
first cell V1,1.  When I create the other variables I want to associate
each line with the V1,1 cell.  I will append many of these files and
therefore want to keep the data related to the facility.

Thanks



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Melissa Ives
Sent: Thursday, May 24, 2007 10:38 AM
To: [hidden email]
Subject: Re: data manipulation


On what criteria will you 'grab one cell value'?


Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Gary Stevens
Sent: Thursday, May 24, 2007 9:17 AM
To: [hidden email]
Subject: [SPSSX-L] data manipulation

I would like to grab one cell value and make it the value of every cell
in another column.


V1 V2 FacilityCounty


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: data manipulation

Melissa Ives
In reply to this post by Gary Stevens-2
Seems to me you are looking at a nested file.
Go to the SPSS help and enter "data files, nested" in the index tab.
You will likely end up using something like the following:

FILE TYPE NESTED.
RECORD TYPE 1.
DATA LIST /FACID 1-N.
RECORD TYPE 2.
DATA LIST /data 6-N.
END FILE TYPE.

Melissa

-----Original Message-----
From: Gary Stevens [mailto:[hidden email]]
Sent: Thursday, May 24, 2007 10:31 AM
To: Melissa Ives
Subject: RE: Re: data manipulation

In example 1, I have imported my file.  In the first row, FacID# under
V1, is the only data. The other data in V1 is not pertinent to my
question In example 2, I want to add that facID# to each row of data
under the Facility variable.  I will do this with each file I import and
then append them.  I will then be able to crosstab by Facility etc.


V1      V2      Facility   County
facID#  -       -       -
752     data
7569    data
4545    data
445     data
2775    data


V1      V2      Facility   County
facID#  -       -       -
752     data    facID#
7569    data    facID#
4545    data    facID#
445     data    facID#
2775    data    facID#



-----Original Message-----
From: Melissa Ives [mailto:[hidden email]]
Sent: Thursday, May 24, 2007 11:09 AM
To: Gary Stevens
Cc: [hidden email]
Subject: RE: Re: data manipulation


Gary,

I guess I am still not following you.  When you create variables, they
are usually in columns, not rows, so new variables would be associated
with the first variable in any given row.

It may be simplest to read in the data, then use a simple compute
statement such as:
        Compute FACID=123.
        save outfile='fac123.sav'/keep=FACID <the rest of the
variables>.
Where 123 is the facility number--that would need to change each time
you read in a new file.

If what you are saying is that you have multiple text files by facility
and each one has a single row with one variable in it, look at reading
in a nested datafile.

123
A B C 123 343
C B A 234 334

Melissa

-----Original Message-----
From: Gary Stevens [mailto:[hidden email]]
Sent: Thursday, May 24, 2007 9:59 AM
To: Melissa Ives
Subject: RE: Re: data manipulation

I am importing a text file and each file has the facility number in the
first cell V1,1.  When I create the other variables I want to associate
each line with the V1,1 cell.  I will append many of these files and
therefore want to keep the data related to the facility.

Thanks



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Melissa Ives
Sent: Thursday, May 24, 2007 10:38 AM
To: [hidden email]
Subject: Re: data manipulation


On what criteria will you 'grab one cell value'?


Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Gary Stevens
Sent: Thursday, May 24, 2007 9:17 AM
To: [hidden email]
Subject: [SPSSX-L] data manipulation

I would like to grab one cell value and make it the value of every cell
in another column.


V1 V2 FacilityCounty


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.