Please HELP! need to combine variables and it's not working :(

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

Please HELP! need to combine variables and it's not working :(

suzycat
Hi! Please, please help! have a paper due in 8 days! and can't figure out how to work this out in SPSS. I am looking at whehter there is a relationship between unintended pregnancies (defined as the summation of mistimed and unwanted pregnancies) and experience with intimate partner violence.

I need to create a dependent variable (unintended pregnancies) from the following variables:

1st child-time wanted pregnancy:
1=then
2=later (mistimed)
3=no more (unwanted)

2nd child-time wanted pregnancy:
1=then
2=later (mistimed)
3=no more (unwanted)

3rd child-time wanted pregnancy:
1=then
2=later (mistimed)
3=no more (unwanted)

4th child-time wanted pregnancy:
1=then
2=later (mistimed)
3=no more (unwanted)

Current pregnancy wanted:
1=then
2=later (mistimed)
3=no more (unwanted)

I need to add up all the "later" and "no mores" to create a dependent variable of unintended pregnancies. How on earth do i do this!? I've tried everything and I'm doing something wrong - please help me! I am using a demographic and health survey - so it is a large dataset with over 11,000 cases and over 4,000 variables, so something efficient would really help! ahhh i'm so lost!

=====================
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
|

RE: Please HELP! need to combine variables and it's not working :(

MaxJasper

RECODE child1 child2 child3 child4 pregNow (2 thru 3=2).

EXECUTE.

 

From: suzycat [via SPSSX Discussion] [mailto:[hidden email]]
Sent: 2014-Aug-19 17:49
To: MaxJasper
Subject: Please HELP! need to combine variables and it's not working :(

 

Hi! Please, please help! have a paper due in 8 days! and can't figure out how to work this out in SPSS. I am looking at whehter there is a relationship between unintended pregnancies (defined as the summation of mistimed and unwanted pregnancies) and experience with intimate partner violence.

I need to create a dependent variable (unintended pregnancies) from the following variables:

1st child-time wanted pregnancy:

·         1=then

·         2=later (mistimed)

·         3=no more (unwanted)

 

2nd child-time wanted pregnancy:

·         1=then

·         2=later (mistimed)

·         3=no more (unwanted)

 

3rd child-time wanted pregnancy:

·         1=then

·         2=later (mistimed)

·         3=no more (unwanted)

 

4th child-time wanted pregnancy:

·         1=then

·         2=later (mistimed)

·         3=no more (unwanted)

 

Current pregnancy wanted:

·         1=then

·         2=later (mistimed)

·         3=no more (unwanted)

 

I need to add up all the "later" and "no mores" to create a dependent variable of unintended pregnancies. How on earth do i do this!? I've tried everything and I'm doing something wrong - please help me! I am using a demographic and health survey - so it is a large dataset with over 11,000 cases and over 4,000 variables, so something efficient would really help! ahhh i'm so lost!

Reply | Threaded
Open this post in threaded view
|

Re: Please HELP! need to combine variables and it's not working :(

Bruce Weaver
Administrator
In reply to this post by suzycat
If I follow, you want a count of all "later" or "no more" responses.  Try something like this (untested--no SPSS on this machine):

COUNT Later_NoMore = Child1 Child2 Child3 Child4 Current (2 THRU 3).
VARIABLE LABELS Later_NoMore "Number of mistimed or unwanted pregnancies".

HTH.


suzycat wrote
Hi! Please, please help! have a paper due in 8 days! and can't figure out how to work this out in SPSS. I am looking at whehter there is a relationship between unintended pregnancies (defined as the summation of mistimed and unwanted pregnancies) and experience with intimate partner violence.

I need to create a dependent variable (unintended pregnancies) from the following variables:

1st child-time wanted pregnancy:
1=then
2=later (mistimed)
3=no more (unwanted)

2nd child-time wanted pregnancy:
1=then
2=later (mistimed)
3=no more (unwanted)

3rd child-time wanted pregnancy:
1=then
2=later (mistimed)
3=no more (unwanted)

4th child-time wanted pregnancy:
1=then
2=later (mistimed)
3=no more (unwanted)

Current pregnancy wanted:
1=then
2=later (mistimed)
3=no more (unwanted)

I need to add up all the "later" and "no mores" to create a dependent variable of unintended pregnancies. How on earth do i do this!? I've tried everything and I'm doing something wrong - please help me! I am using a demographic and health survey - so it is a large dataset with over 11,000 cases and over 4,000 variables, so something efficient would really help! ahhh i'm so lost!

=====================
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
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

RE: Please HELP! need to combine variables and it's not working :(

Art Kendall
In reply to this post by MaxJasper
Guessing what you want something like the following  syntax might work.

Open a new instance of SPSS.
Paste the syntax below into a syntax window.
Run it.

new file.
input program.
   loop id = 1 to 25.
      end case.
   end loop.
   end file.
end input program.
numeric pregnancy1 to pregnancy4 Current NumPrevious (f1).
compute NumPrevious =RND(RV.UNIFORM(-.5,4.5)).
execute.

do repeat time = pregnancy1 to pregnancy4/ kount= 1 to 4.
compute time=0.
do if kount le NumPrevious.
compute time = RND(RV.UNIFORM(.5,3.5)).
end if.
end repeat.
compute Current =  RND(RV.UNIFORM(.5,3.5)).
missing values  pregnancy1 to pregnancy4 (0).
numeric TotalPregnancies (f1).
compute TotalPregnancies = 1 + NumPrevious.
Count Unwanted# = pregnancy1 to pregnancy4 Current(2,3).
numeric EverUnwanted (f1).
compute EverUnwanted = Unwanted# gt 0.
List.

Art Kendall
Social Research Consultants