Digital Developer Conference: a FREE half-day online conference focused on AI & Cloud – North America: Nov 2 – India: Nov 9 – Europe: Nov 14 – Asia Nov 23 Register now

Close outline
  • United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

SPSS population census and fertility ratio

550004D3EV gravatar image
Question by Guidur  (1) | Oct 04 at 09:31 PM syntaxvariablescompute

Hi guys,

I am trying to calculate a fertility ratio out of a census by group of age. The two main variables I need that are actually found in the census are women from 15 to 49 yrs old and children from 0 to 5 yrs old.

If I take the Child-Women Ratio (CWR) of the population, I just divide the number of children from 0 to 5 yrs old / women from 15 to 49 yrs old = CWR.

But the problem comes when I want to calculate that ratio by group of age (15-19 ; 20-24 ; 25-34; 35-44 ; 45 +). So I need to 'link' children to their mother. I just don't know how to manipulate the data.

There are not actual calculus here, but only data manipulation so I can after it, select the Frequency function and show the occurence.

Another variable I have in the dataset is also the 'relation to the head', which tells me the relation of the individual to the father (so I look for son, daughter and spouse of the same family) and I also have a variable called 'family unit' which indicate thanks to a family number to which family the mother and the children belong.

I cannot just filter the women by group age and then divided by the number of children from 0 to 5. I need to get the children which are associated to the women of the group age. Well, this is how I understand it.

Here is an example I made up on Excel to help visualize what I mean.

alt text

Is anyone has any idea how to make that work ?

Your help would be a lifesaver !

Cheers

capture-decran-le-2019-10-04-a-192721.png (51.0 kB)

People who like this

  0
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

2 answers

  • Sort: 
270003FAQU gravatar image

Answer by jkpeck (6143) | Oct 05 at 01:42 PM

@Guidur

Real family data is likely to be more complicated - grandchildren, subfamilies, missing female parent, kids not children of female parent etc, but this code should get reasonably close.

 * choose female head or spouse and sons or daughters.  
 select if (gender eq "F" and relation eq "Head" or relation eq "Spouse") or relation eq "Son" or relation eq "Daughter".  
 
 * calculate family size.  
 aggregate
   /outfile=* mode=addvariables
   /break=FamilyNum
   /familySize=n.
 
 * select female parent (hoping there is only one such).  
 select if relation eq "Head" or relation eq "Spouse".  
 
 * reduce count by the parent, group ages, and tabulate.  
 compute numkids = familySize - 1.  
 
 compute agegroup = trunc(age/5).  
 ctables /table agegroup by numkids[S].  
 

I just binned the ages by 5 year intervals. For a more sophisticated grouping, use Transform > Visual Binning.

Comment

People who like this

  0   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
550004D3EV gravatar image

Answer by Guidur (1) | Oct 06 at 11:51 PM

Thank you JkPeck

I'll try this out and let you know if this work.

I am kind of new with syntax.

Best,

Comment

People who like this

  0   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

Follow this question

185 people are following this question.

Answers

Answers & comments

Related questions

SPSS Syntax - DO IF Else logic: Computing variable "if any three variables equal...." 1 Answer

Splitting a string variable divided by comma's into new single variables 2 Answers

Compute one variable that represents 2 variables. (UMBRELLA VARIABLE) 0 Answers

Create a new variable based on date 0 Answers

Recoding variables with SPSS Syntax 0 Answers

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • Data and AI
  • DataPower
  • Decision Optimization
  • DevOps Build
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • Hyper Protect
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PartnerWorld Developer Support
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges