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 (March 2009)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 30 Mar 2009 07:01:13 -0700
Reply-To:     Albert-jan Roskam <fomcl@yahoo.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Albert-jan Roskam <fomcl@yahoo.com>
Subject:      Re: Compute new variable
Comments: To: Darren Philpott <Darren.Philpott@shlgroup.com>
Content-Type: text/plain; charset=iso-8859-1

Hi again,

Maybe this works, but double-check if you get the desired results in case there are missing values.

do repeat #var = var1 to var6 / #value = 1 to 6 / #cntvar = #cntvar1 to #cntvar6. #cntvar = COUNT #var (#value). end repeat print. compute maxcnt = max (#cntvar1 to #cntvar6). exe.

Cheers!! Albert-Jan

--- On Mon, 3/30/09, Darren Philpott <Darren.Philpott@shlgroup.com> wrote:

> From: Darren Philpott <Darren.Philpott@shlgroup.com> > Subject: RE: Compute new variable > To: "Albert-jan Roskam" <fomcl@yahoo.com>, "SPSSX-L@LISTSERV.UGA.EDU" <SPSSX-L@LISTSERV.UGA.EDU> > Date: Monday, March 30, 2009, 3:47 PM > Thanks, but... > > I'm not sure this is the best way to do this though. > > I need to do the following > > Each variable is a response to a question. Each > response can be a value between 0 and 6. I need to > flag instances where candidates respond to 6 or more > questions in sequence with the same answer eg. > > 1 2 3 > 4 5 5 > 5 5 5 > 5 5 6 > 1 0 > > To use count would you not need to count variables 1 - 6 > that equal 0 then repeat for these variables but counting > those that equal 1, 2, 3, 4, 5, 6? The repeat the > steps for items 2-7 and so on.. > > Cheers, > Darren > > -----Original Message----- > From: Albert-jan Roskam [mailto:fomcl@yahoo.com] > Sent: 30 March 2009 11:26 > To: SPSSX-L@LISTSERV.UGA.EDU; > Darren Philpott > Subject: Re: Compute new variable > > > Hi, > > COUNT does wat you want: > countvar = count v1 to v6 (3). > > You can recode it to make countvar binary, of course. > > Cheers!! > Albert-Jan > > > --- On Mon, 3/30/09, Darren Philpott <Darren.Philpott@shlgroup.com> > wrote: > > > From: Darren Philpott <Darren.Philpott@shlgroup.com> > > Subject: Compute new variable > > To: SPSSX-L@LISTSERV.UGA.EDU > > Date: Monday, March 30, 2009, 12:16 PM > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Hi > > > > > > I > > have a data set > > containing candidate responses to a > test. The > > responses > > are numeric (1-5). Each candidate > represents a > > case and the > > responses to each test question are > variables 1 - > > 30. > > > > > > I > > need to compute a > > new variable to flag candidates who > have responded with > > the same answer too > > many times in a row e.g. > > > > > > > > For > > example if a > > candidate responds with the same > answer 6 times (e.g. > > 3,3,3,3,3,3) in a row > > anywhere within the 30 questions a > > 'flag' variable should be created > > with a value of 1. > > > > > > > > Any > > ideas on how I > > can compute this variable would be > appreciated, syntax is > > very welcome. > > > > > > Thanks, > > > > Darren > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _____________________________________________________________________ > > > > This e-mail has been scanned for viruses by Verizon > > Business Internet Managed Scanning Services - powered > by > > MessageLabs. For further information visit > > http://www.verizonbusiness.com/uk > > > > > > > > > > > > > > > _____________________________________________________________________ > This e-mail has been scanned for viruses by Verizon > Business Internet Managed Scanning Services - powered by > MessageLabs. For further information visit http://www.verizonbusiness.com/uk > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.0.238 / Virus Database: 270.11.31/2029 - Release > Date: 03/29/09 16:56:00 > > _____________________________________________________________________ > This e-mail has been scanned for viruses by Verizon > Business Internet Managed Scanning Services - powered by > MessageLabs. For further information visit http://www.verizonbusiness.com/uk >

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