identifying consecutive numbers (runs)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

identifying consecutive numbers (runs)

msherman

Dear Listers:  I have a data set that  has responses from 300 individuals who have responded to a survey that contains 240 items. The 240 tap five different domains.   Prior to scoring each domain one can obtain an invalidity index which assesses whether an individual responded with a Strongly Disagree (a response of 1) consecutively for 11 items anywhere within the 240 items.  Looking for a program that would allow me to identify those individuals.  Thanks, martin sherman

 

 

Reply | Threaded
Open this post in threaded view
|

Re: identifying consecutive numbers (runs)

Spousta Jan

Hi Martin, try this (supposing your variables are v1 to v240):

 

compute n = 0.

do repe x = v1 to v239 / y = v2 to v240 .

if (x = 1 and y = 1 and n < 10) n = n + 1.

if ((x ne 1 or y ne 1) and n < 10) n = 0.

end repe.

if (n < 10) n = 0.

if (n = 10) n = 1.

exe.

 

Results are in the variable n: 0 means "no 11 consecutive ones", 1 means "there are 11 consecutive ones in the row".

Best,

Jan



From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Martin Sherman
Sent: Tuesday, October 19, 2010 3:22 PM
To: [hidden email]
Subject: identifying consecutive numbers (runs)

Dear Listers:  I have a data set that  has responses from 300 individuals who have responded to a survey that contains 240 items. The 240 tap five different domains.   Prior to scoring each domain one can obtain an invalidity index which assesses whether an individual responded with a Strongly Disagree (a response of 1) consecutively for 11 items anywhere within the 240 items.  Looking for a program that would allow me to identify those individuals.  Thanks, martin sherman

 

 

 

_____________

Tato zpráva a všechny připojené soubory jsou důvěrné a určené výlučně adresátovi(-ům). Jestliže nejste oprávněným adresátem, je zakázáno jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto informací. Jestliže jste tento mail dostali neoprávněně, prosím, uvědomte odesilatele a smažte zprávu i přiložené soubory. Odesilatel nezodpovídá za jakékoliv chyby nebo opomenutí způsobené tímto přenosem.

P Jste si jisti, že opravdu potřebujete vytisknout tuto zprávu a/nebo její přílohy? Myslete na přírodu.

 


This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the message as well as all attached documents. The sender does not accept liability for any errors or omissions as a result of the transmission.

 

P Are you sure that you really need a print version of this message and/or its attachments? Think about nature.

-.- --
Reply | Threaded
Open this post in threaded view
|

RATIO STATISTICS bug?

Josep M Domenech

From version 16, RATIO STATISTICS gives wrong results because it excludes negative values. For instance:

 

DATA LIST FREE /X X1.

Begin data.

-3 1 -2 1 0 1 4 1 5 1

End data.

RATIO STATISTICS X WITH X1 /PRINT= CIN(95) MEDIAN .

 

To SPSS Support: will you include this bug in the next patch? 

Thanks,

 

Jose M Domenech

Laboratori d'Estadistica Aplicada

Universitat Autonoma de Barcelona

Reply | Threaded
Open this post in threaded view
|

Automatic reply: RATIO STATISTICS bug?

Pablo Reinoso

Estaré fuera de la oficina a partir del lunes 18 al 29 de Octubre, por temas de soporte técnico comunicarse con Carlos Padilla [hidden email], por temas de capacitación comunicarse con Marcia Avilés [hidden email] fono:+56.2.4153478

Reply | Threaded
Open this post in threaded view
|

Re: RATIO STATISTICS bug?

Jon K Peck
In reply to this post by Josep M Domenech
This is the correct and documented behavior for RATIO.  From the help,
"Assumptions. The variables that define the numerator and denominator of the ratio should be scale variables that take positive values. "

Jon Peck
Senior Software Engineer, IBM
[hidden email]
312-651-3435




From:        Josep M Domenech <[hidden email]>
To:        [hidden email]
Date:        10/19/2010 09:48 AM
Subject:        [SPSSX-L] RATIO STATISTICS bug?
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




From version 16, RATIO STATISTICS gives wrong results because it excludes negative values. For instance:
 
DATA LIST FREE /X X1.
Begin data.
-3 1 -2 1 0 1 4 1 5 1
End data.
RATIO STATISTICS X WITH X1 /PRINT= CIN(95) MEDIAN .
 
To SPSS Support: will you include this bug in the next patch?  
Thanks,
 
Jose M Domenech
Laboratori d'Estadistica Aplicada
Universitat Autonoma de Barcelona
Reply | Threaded
Open this post in threaded view
|

Re: RATIO STATISTICS bug?

Marta Garcia-Granero
In reply to this post by Josep M Domenech
El 19/10/2010 16:54, Josep M Domenech escribió:

From version 16, RATIO STATISTICS gives wrong results because it excludes negative values. For instance:

 

DATA LIST FREE /X X1.

Begin data.

-3 1 -2 1 0 1 4 1 5 1

End data.

RATIO STATISTICS X WITH X1 /PRINT= CIN(95) MEDIAN .

 



Hi Josep (maybe you remember me, I attended the first edition of your course "Regression models in Epidemiology" some years ago)

When I want to use RATIO to compute a confidence interval for the median of a paired difference, as it seems you are trying to do, I add a constant to the numerator variable to make all values positive (since the command, as Jon Peck replied to you, is intended for positive values), and then I substract it from the confidence limits.

DATA LIST FREE /X X1.

Begin data.

-3 1 -2 1 0 1 4 1 5 1

End data.

TEMPORARY.
COMPUTE X=X+10.

RATIO STATISTICS X WITH X1 /PRINT= CIN(95) MEDIAN .

To make the task more automatic, you can wrap the RATIO command with OMS... END OMS, substract the limits and print the report.

HTH,
Marta García-Granero
--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/
Reply | Threaded
Open this post in threaded view
|

Re: identifying consecutive numbers (runs)

John F Hall
In reply to this post by msherman
Seen Jan's reply, but the the interesting question is are you looking for yea-sayers?  Why 11 consecutive?
 

----- Original Message -----
Sent: Tuesday, October 19, 2010 3:21 PM
Subject: identifying consecutive numbers (runs)

Dear Listers:  I have a data set that  has responses from 300 individuals who have responded to a survey that contains 240 items. The 240 tap five different domains.   Prior to scoring each domain one can obtain an invalidity index which assesses whether an individual responded with a Strongly Disagree (a response of 1) consecutively for 11 items anywhere within the 240 items.  Looking for a program that would allow me to identify those individuals.  Thanks, martin sherman