Sexrounds

Obviously, I can do this using the following code: *R2*; totrndact2=3Dsum(sexround2); *R3*; totrndact3=3Dsum(sexround2,sexround3); *R4*; totrndact4=3Dsum(sexround2, sexround3, sexround4); *R5*; totrndact5=3Dsum(sexround2, sexround3, sexround4, sexround5); *R6*; totrndact6=3Dsum(sexround2, sexround3, sexround4, sexround5, sexround6); *R7*; totrndact7=3Dsum(sexround2, sexround3, sexround4, sexround5, sexround6, sexround7); *R8*; totrndact8=3Dsum(sexround2, sexround3, sexround4, sexround5, sexround6, sexround7, sexround8); However, I'd like ata Have ; Infile Cards ; Input R1 R2 R3 R4 R5 R6 R7 ; Cards ; 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 1 0 1 0 1 ; Run ; Data Need ( Drop = Total I ) ; Set Have ; Array R ( 7 ) ; Array TR ( 7 ) ; Total = 0 ; Do I = 1 To Dim( R ) ; Total R( I ) ; TR( I ) = Total ; End ; Run ; Proc Print Data = Need ; Run ; Toby Dunn To sensible men, every day is a day of reckoning. Gardner The important thing is this: To be able at any moment to sacrifice that which we are for what we could become.Nothing is solved and it just makes you walk funny.They are simply summing, for each round, the total number of rounds that respondent has been sexually active. COM ] Sent: Thursday, March 29, 2007 AM To: Lisa Mincieli; [email protected] Sex in R2 Sex in R3 Sex in R4 Sex in R5 Sex in R6 Sex in R7 Sex in R8 Total rounds sexually active at R2 Total rounds sexually active at R3 Total rounds sexually active at R4 Total rounds sexually active at R5 Total rounds sexually active at R6 Total rounds sexually active at R7 Total rounds sexually active at R8 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 2 0 0 0 0 1 1 1 0 0 0 0 1 2 3 3 0 1 0 1 0 1 1 0 1 1 2 2 3 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 1 1 0 1 1 1 1 1 2 2 3 4 5 6 6 1 0 0 0 1 1 1 1 1 1 1 2 3 4 7 0 0 0 0 1 0 1 0 0 0 0 1 1 2 Let me know if more info would be helpful. COM Subject: RE: Sum function with array elements Lisa , How you go about doing this largely depends on your data structure and your version of SAS.I see a complex statistical anlaysis looming over the horizon, and I'd like to try to help you before you get stuck there.Depending on what your data are, and where they come from, and how you have them constructed, you may have one or more of the following: A) a bad database design; B) a bad plan for statistical analysis; C) a bad way of computing the indices you are after; or D) all of the above.Could you write back to SAS-L and maybe explain a bit more about your data and your data structure and your data sources and your analysis objectives?It looks like you have your data for your waves in a row, instead of in columns. HTH, David _________________________________________________________________ Mortgage refinance is hot 1) Rates near 30-yr lows 2) Good credit get intro-rate 4.625%* https://www2.nextag.com/goto.jsp?

Sexrounds-67Sexrounds-87Sexrounds-56

Hi all, I am trying to create a series of 7 variables (one for each round of the survey data I am using) measuring how many rounds each respondent has been sexually active (totrndsact2-8).

Toby Dunn To sensible men, every day is a day of reckoning. Gardner The important thing is this: To be able at any moment to sacrifice that which we are for what we could become.

~Charles Du Bois Don't get your knickers in a knot.

Otherwise we will be guessing and well the answers may not be as optimal as they could be.

~Kathryn Carpenter From: Lisa Hi, Lisa, Here is one way.

Leave a Reply