Hi there,
I need to create various categories to identify federal poverty level status based on the person’s income and family size. What suggestions do you all have for simplifying the following syntax?
A household of 1 is at 100% of the FPL if their income is at/below 11,670. Increase that amount by $4060 to get the cutoff for a household of 2. As the family size increases by 1, the cutoff increase by 4060. The above is true for patients at 125% of the FPL, but income increases by 5075.
*200%. IF FmSz=1 and FmInc LE 22980 PovertyLevel=5. IF FmSz=2 and FmInc LE 31020 PovertyLevel=5. IF FmSz=3 and FmInc LE 39060 PovertyLevel=5. Etc, until I reach famil size 20.
*175%. IF FmSz=1 and FmInc LE 20108 PovertyLevel=4. IF FmSz=2 and FmInc LE 27143 PovertyLevel=4. IF FmSz=3 and FmInc LE 34178 PovertyLevel=4. Etc, until I reach famil size 20.
*150%. IF FmSz=1 and FmInc LE 17235 PovertyLevel=3. IF FmSz=2 and FmInc LE 23265 PovertyLevel=3. IF FmSz=3 and FmInc LE 29295 PovertyLevel=3. Etc, until I reach famil size 20.
*125%. IF FmSz=1 and FmInc LE 14363 PovertyLevel=2. IF FmSz=2 and FmInc LE 19388 PovertyLevel=2. IF FmSz=3 and FmInc LE 24413 PovertyLevel=2. Etc, until I reach famil size 20.
*100%. IF FmSz=1 and FmInc LE 11490 PovertyLevel=1. IF FmSz=2 and FmInc LE 15510 PovertyLevel=1. IF FmSz=3 and FmInc LE 19530 PovertyLevel=1. Etc, until I reach famil size 20.
*Over 200%. IF FmSz=1 and FmInc GT 22980 PovertyLevel=6. IF FmSz=2 and FmInc GT 31020 PovertyLevel=6. IF FmSz=3 and FmInc GT 39060 PovertyLevel=6. Etc, until I reach famil size 20.
Thanks in advance for your ideas! Yvonne |
Given your description this is how I think it should work - with a caveat. I'm unsure what your baseline is for the higher % poverty categories. That is, I thought from your description 200% poverty for 1 person would be equal to (11670*2 = 23340), but you have it listed in your IF statements as 22980. So I'm unsure where this baseline comes from. [I proceed as if it should be 23340 - but the code can be adapted if this is incorrect]
Basically what the code does is loop through the percent categories backwards using a DO REPEAT statement. You can figure out the adjusted poverty line for different family sizes by some simple algebra, so there is no need to conduct 20 separate IF statements or loop through them. The ELSE IF condition is for the 6th poverty level category (the not in poverty category), which is probably not needed if you initialize PovertyLevel to a value of 6 to begin with. If the criteria is "20 or more equals 20" make sure to RECODE the FmSz variable accordingly before this procedure. *******************************************. *Making some fake data. DATA LIST FREE / FmSz FmInc ShouldBe. BEGIN DATA. 1 11400 1 2 15000 1 3 19000 1 1 23000 6 2 19300 2 3 29200 3 END DATA. COMPUTE #Min = 11670. COMPUTE #Add = 4060. COMPUTE #Counter = 6. DO REPEAT Per = 2 2 1.75 1.5 1.25 1. COMPUTE #AdjLine = (#Min*Per) + (FmSz-1)*(Per*#Add). DO IF #Counter < 6. IF FmInc LE #AdjLine PovertyLevel = #Counter. ELSE IF #Counter = 6. IF FmInc GT #AdjLine PovertyLevel = #Counter. END IF. COMPUTE #Counter = #Counter - 1. END REPEAT. EXECUTE. *******************************************. |
Wow Andy, thanks so much! It worked like a charm.
The baseline you used is correct as it reflects the 2014 updated numbers. It was my fault for emailing syntax I used to create the 2013 federal poverty level categories. I appreciate your help! Best regards, Yvonne -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Andy W Sent: Tuesday, July 22, 2014 1:44 PM To: [hidden email] Subject: Re: create categories for federal poverty level Given your description this is how I think it should work - with a caveat. I'm unsure what your baseline is for the higher % poverty categories. That is, I thought from your description 200% poverty for 1 person would be equal to (11670*2 = 23340), but you have it listed in your IF statements as 22980. So I'm unsure where this baseline comes from. [I proceed as if it should be 23340 - but the code can be adapted if this is incorrect] Basically what the code does is loop through the percent categories backwards using a DO REPEAT statement. You can figure out the adjusted poverty line for different family sizes by some simple algebra, so there is no need to conduct 20 separate IF statements or loop through them. The ELSE IF condition is for the 6th poverty level category (the not in poverty category), which is probably not needed if you initialize PovertyLevel to a value of 6 to begin with. If the criteria is "20 or more equals 20" make sure to RECODE the FmSz variable accordingly before this procedure. *******************************************. *Making some fake data. DATA LIST FREE / FmSz FmInc ShouldBe. BEGIN DATA. 1 11400 1 2 15000 1 3 19000 1 1 23000 6 2 19300 2 3 29200 3 END DATA. COMPUTE #Min = 11670. COMPUTE #Add = 4060. COMPUTE #Counter = 6. DO REPEAT Per = 2 2 1.75 1.5 1.25 1. COMPUTE #AdjLine = (#Min*Per) + (FmSz-1)*(Per*#Add). DO IF #Counter < 6. IF FmInc LE #AdjLine PovertyLevel = #Counter. ELSE IF #Counter = 6. IF FmInc GT #AdjLine PovertyLevel = #Counter. END IF. COMPUTE #Counter = #Counter - 1. END REPEAT. EXECUTE. *******************************************. ----- Andy W [hidden email] http://andrewpwheeler.wordpress.com/ -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/create-categories-for-federal-poverty-level-tp5726784p5726787.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== 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 CONFIDENTIALITY NOTICE: This e-mail and any attachments are intended only for the use of the individual to whom (or entity to which) the e-mail is addressed and may contain information that is protected, privileged, confidential, or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of the communication is strictly prohibited. If you think you have received this communication in error, please notify the sender immediately. ===================== 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 |
Free forum by Nabble | Edit this page |