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 (June 2011)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 9 Jun 2011 16:51:14 -0700
Reply-To:     "Parise, Carol A." <PariseC@sutterhealth.org>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Parise, Carol A." <PariseC@sutterhealth.org>
Subject:      Re: automate computations
Comments: To: David Marso <david.marso@gmail.com>
In-Reply-To:  <1307496464627-4463647.post@n5.nabble.com>
Content-Type: text/plain; charset="us-ascii"

David,

>I'm not sure how this achieves the stated goal of "grouping" people.

Point well taken and thank you for the code. Once i run this, my plan was again to use a bunch of compute statements to find all of the people who did the same task in the same year.

I would love it if you or someone had a more elegant solution. Maybe one that doesn't require flattening the file?

Thanks Carol

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of David Marso Sent: Tuesday, June 07, 2011 6:28 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Re: automate computations

"create a compute for every permutation of year/task! " ... First of all, forget about explicitly computing every combination. Use VECTORS and a simple compute as follows:

NUMERIC Task01_1974 TO Task01_2010 Task02_1974 TO Task02_2010 ............ .. etc ....... TASK28_1974 TO Task28_2010. RECODE Task01_1974 TO Task28_2010 (ELSE=0). VECTOR TaskYear=Task01_1974 TO Task28_2010. COMPUTE TaskYear( (Task-1) * 36 + Year - 1974 + 1) =1.

"I suspect there may be a more efficient method to group people who have done the same tasks in the same year and if anyone has one, I thank you in advanced."

I'm not sure how this achieves the stated goal of "grouping" people. HTH, but I'm not sure it does ;-) David ------

Parise, Carol A. wrote: > > Hi all, > > This is another question about the same data that i asked about a few > weeks agoin in the question: "CasesToVars or better idea". Marta > provided some syntax to flip the file which worked great. The next > goal is to identify the people who performed the same tasks in the > same year and compare their time on the tasks. When i flattened the > file, i started creating a bunch of computes: > > compute TaskOne_1986 = 0. > if (Year =1986 and Task = 1) TaskOne_1986=1. > > etc. > > then planned to do another set of computes: If TaskOne_1986=1 and > TaskOne_1987=1 and TaskOne=1990 etc to find groups of people who did a > particular task in a particular year. After a few rounds of "computes" > i started wondering of there was a more automated way to do this. > > i went back to the "long file" format (my data look like this): > ID Year Task Time Age > 1 1986 ONE 2:15 40 > 1 1990 ONE 3:00 44 > 1 2000 ONE 1:59 45 > 1 2005 TWO 4:05 50 > 1 2007 TWO 3:58 52 > 1 2008 TWO 3:42 53 > 2 2001 TWO 3:00 30 > 2 2002 THREE 1:35 31 > 2 2003 THREE 1:55 33 > 2 2005 TWO 2:25 35 > 2 2006 THREE 2:40 36 > > ...and ran a task by year crosstabulation table. Here is an example of > the results of this file. > > <SNIP TABLE> > > There are a total of 28 tasks performed over 36 (1974-2010) years. > Using my current strategy means i would need to create a compute for > every permutation of year/task! I also need to know the age of people > in the year that they performed the task. I ultimately plan to use > linear mixed models so i don't need to flatten the file. > > I suspect there may be a more efficient method to group people who > have done the same tasks in the same year and if anyone has one, I > thank you in advanced. > > Carol >

-- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/small-Cronbach-s-Alpha-below-60-tp4422312p4463647.html Sent from the SPSSX Discussion mailing list archive at Nabble.com.

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

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