LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2010)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 21 Sep 2010 14:02:14 -0400
Reply-To:     Art@DrKendall.org
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Art Kendall <Art@DrKendall.org>
Organization: Social Research Consultants
Subject:      Re: counting frequencies of 30 columns of children who are a
              certain              age range AND going to school.
Comments: To: Deepa Lakshmi Shanadi <deepab121@yahoo.com>
In-Reply-To:  <950405.60832.qm@web56904.mail.re3.yahoo.com>
Content-type: text/html; charset=ISO-8859-1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> did the syntax with simulated data do what you want?<br> If not please copy the output from the second LIST command that you get and paste it twice in an email.<br> edit the second copy so that it shows the results you are looking for.<br> <br> <br> <br> If it did, just change the arguments in the range function to <b><big><big><tt>range(b5,7,15)</tt></big></big></b> <blockquote type="cite"><tt>if&nbsp; range(b5,3,18) kids = kids +1. <br> if&nbsp; range(b5,3,18) and b8 eq 1 kidsinschool = kidsinschool + 1.</tt></blockquote> <tt>if&nbsp; range(b5,7,15) kids = kids +1. <br> if&nbsp; range(b5,7,15) and b8 eq 1 kidsinschool = kidsinschool + 1.</tt><br> <br> Art Kendall<br> Social Research Consultants<br> <br> On 9/21/2010 11:54 AM, Deepa Lakshmi Shanadi wrote: <blockquote cite="mid:950405.60832.qm@web56904.mail.re3.yahoo.com" type="cite"> <style type="text/css"><!-- DIV {margin:0px;} --></style> <div style="font-family: Courier New,courier,monaco,monospace,sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Dear all,<br> I sent an email on needing to count how many children there are in 30 columns that are between the ages of 3 to 18 AND are going to school. Thanks for your response. I picked the following and it seemed to work. <br> <br> This is what I went with. IT worked for 3to18 and going to school, but then I adapted it to age range 7to15 AND going to school, but for some reason it is only picking up the part on those that are going to school, so if someone is NOT 7to15 years old, but are going to school, it is counting that. Any insight on why? Also how would you shorten this syntax?<br> <br> FILTER OFF.<br> USE ALL.<br> EXECUTE.<br> <br> If ((b5_age$01 &gt; 6 | b5_age$01 &lt; 16) &amp; (B8_CURATSCH$01 = 1)) v1 = 1.<br> If ((b5_age$02 &gt; 6 | b5_age$02 &lt;16) &amp; (B8_CURATSCH$02&nbsp; = 1)) v2 = 1.<br> If ((b5_age$03 &gt; 6 | b5_age$03 &lt; 16) &amp; (B8_CURATSCH$03&nbsp; = 1)) v3 = 1.<br> If ((b5_age$04 &gt; 6 | b5_age$04 &lt; 16) &amp; (B8_CURATSCH$04 = 1)) v4 = 1.<br> If ((b5_age$05 &gt; 6 | b5_age$05 &lt; 16) &amp; (B8_CURATSCH$05&nbsp;&nbsp; = 1)) v5 = 1.<br> If ((b5_age$06 &gt; 6 | b5_age$06 &lt; 16) &amp; (B8_CURATSCH$06&nbsp; = 1)) v6 = 1.<br> If ((b5_age$07 &gt; 6 | b5_age$07 &lt; 16) &amp; (B8_CURATSCH$07&nbsp;&nbsp; = 1)) v7 = 1.<br> If ((b5_age$08 &gt; 6 | b5_age$08 &lt; 16) &amp; (B8_CURATSCH$08&nbsp; = 1)) v8 = 1.<br> If ((b5_age$09 &gt; 6 | b5_age$09 &lt; 16) &amp; (B8_CURATSCH$09&nbsp; = 1)) v9 = 1.<br> If ((b5_age$10 &gt; 6 | b5_age$10 &lt; 16) &amp; (B8_CURATSCH$10 = 1)) v10 = 1.<br> If ((b5_age$11 &gt; 6 | b5_age$11 &lt; 16) &amp; (B8_CURATSCH$11 = 1)) v11 = 1.<br> If ((b5_age$12 &gt; 6 | b5_age$12 &lt; 16) &amp; (B8_CURATSCH$12 = 1)) v12 = 1.<br> If ((b5_age$13 &gt; 6 | b5_age$13 &lt; 16) &amp; (B8_CURATSCH$13= 1)) v13 = 1.<br> If ((b5_age$14&gt; 6 | b5_age$14 &lt; 16) &amp; (B8_CURATSCH$14= 1)) v14 = 1.<br> If ((b5_age$15 &gt; 6 | b5_age$15 &lt; 16) &amp; (B8_CURATSCH$15= 1)) v15 = 1.<br> If ((b5_age$16 &gt; 6 | b5_age$16 &lt; 16) &amp; (B8_CURATSCH$16= 1)) v16 = 1.<br> If ((b5_age$17 &gt; 6 | b5_age$17 &lt; 16) &amp; (B8_CURATSCH$17= 1)) v17 = 1.<br> If ((b5_age$18&gt; 6 | b5_age$18 &lt; 16) &amp; (B8_CURATSCH$18= 1)) v18 = 1.<br> If ((b5_age$19&gt; 6 | b5_age$19 &lt; 16) &amp; (B8_CURATSCH$19= 1)) v19 = 1.<br> If ((b5_age$20 &gt; 6 | b5_age$20 &lt; 16) &amp; (B8_CURATSCH$20= 1)) v20 = 1.<br> If ((b5_age$21 &gt; 6 | b5_age$21 &lt; 16) &amp; (B8_CURATSCH$21= 1)) v21 = 1.<br> If ((b5_age$22 &gt; 6 | b5_age$22 &lt; 16) &amp; (B8_CURATSCH$22= 1)) v22= 1.<br> If ((b5_age$23&gt; 6 | b5_age$23 &lt; 16) &amp; (B8_CURATSCH$23= 1)) v23 = 1.<br> If ((b5_age$24&gt; 6 | b5_age$24 &lt; 16) &amp; (B8_CURATSCH$24= 1)) v24 = 1.<br> If ((b5_age$25&gt; 6 | b5_age$25 &lt; 16) &amp; (B8_CURATSCH$25= 1)) v25= 1.<br> If ((b5_age$26&gt; 6 | b5_age$26 &lt; 16) &amp; (B8_CURATSCH$26= 1)) v26 = 1.<br> If ((b5_age$27&gt; 6 | b5_age$27 &lt; 16) &amp; (B8_CURATSCH$27= 1)) v27 = 1.<br> If ((b5_age$28&gt; 6 | b5_age$28 &lt; 16) &amp; (B8_CURATSCH$28= 1)) v28 = 1.<br> If ((b5_age$29&gt; 6 | b5_age$29 &lt; 16) &amp; (B8_CURATSCH$29= 1)) v29 = 1.<br> If ((b5_age$30&gt; 6 | b5_age$30 &lt; 16) &amp; (B8_CURATSCH$30= 1)) v30 = 1.<br> <br> COUNT age7to15andschoolfrequency = v1 to v30&nbsp; (1).<br> EXECUTE.<br> <br> FREQUENCIES VARIABLES=age7to15andschoolfrequency<br> &nbsp; /ORDER=ANALYSIS.<br> <div><br> </div> <!-- cg6.c2.mail.ac4.yahoo.com compressed/chunked Thu Sep 16 16:54:11 PDT 2010 --> <input id="gwProxy" type="hidden"><!--Session data--><input onclick="jsCall();" id="jsProxy" type="hidden"></div> <br> </blockquote> </body> </html>

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (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


Back to: Top of message | Previous page | Main SPSSX-L page