|
Dear all,
I am newbie here and have a newbie kind of problem (I think!): I am trying to calculate a spearman correlation matrix with 259 variables. However, this number exceeds the 100 allowed: Is there any way I can increase the allowed number? Many thanks, Max ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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 |
|
Hi Max
> I am newbie here and have a newbie kind of problem (I think!): I am trying to calculate a spearman correlation matrix with 259 variables. However, this number exceeds the 100 allowed: Is there any way I can increase the allowed number? > > To my knowledge, the 100 variables limit can not be bypassed, but, since Spearman correlation coefficient is simply the Pearson correlation computed on the ranks, you can use this trick: 1) Rank your data (the 259 variables) 2) Run FACTOR (it doesn't have that limit) and ask for the correlation matrix * Fake dataset with 100 cases & 259 variables (replace it by your own real data) *. INPUT PROGRAM. - VECTOR x(259). - LOOP #I = 1 TO 100. - LOOP #J = 1 TO 259. - COMPUTE x(#J) = NORMAL(1). - END LOOP. - END CASE. - END LOOP. - END FILE. END INPUT PROGRAM. execute. * First, you must rank the 259 variables *. RANK VARIABLES=x1 TO x259 (A) /RANK /PRINT=NO. * Now, run FACTOR and ask for the correlation matrix *. FACTOR /VARIABLES Rx1 TO Rx259 /ANALYSIS Rx1 TO Rx259 /PRINT CORRELATION . The significance is not computed, sorry. If you know how to use MATRIX programs, then you can write something to get the p-values matrix if you need them (ask for help if you don't know how, I'll be glad to help) HTH, Marta García-Granero -- For miscellaneous statistical stuff, visit: http://gjyp.nl/marta/ ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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 |
|
Dear list,
I have a string variable called "semester taken" (f/2003, f2004, f2005, f2006 etc.), I would like to select years f/2004 and later, but I'm having trouble getting spss to do this. Is it because this is a string variable?
All suggestions are appreciated,
Stace
|
|
Stace- There are a couple of ways to accomplish this. The first
is to recode the string variable into a numeric variable – sort
descending and then auto recode OR you can write some syntax like this: Compute semester = 0 . If (semester_taken = “f2003”)
semester = 2003 . If (semester_taken = “f2004’)
semester = 2004 . If the Semester_Taken variable always starts with an F (I assume
for Fall) and then has the year follow it, this solution would also work: Compute semester =
Number(Substr(semester_taken,2,4),F4.0). This takes the sub-string of Semester_Taken from the second
position with a length of four. Then it reads the value in as a number
with the assumed format to be F4.0 (4 numbers, 0 decimals). The variable
that’s created will be the default HTH, -Eric From: SPSSX(r) Discussion
[mailto:[hidden email]] On Behalf Of stace swayne Dear list, I have a string variable called "semester taken"
(f/2003, f2004, f2005, f2006 etc.), I would like to select years f/2004 and
later, but I'm having trouble getting spss to do this. Is it because this is a
string variable? All suggestions are appreciated, Stace |
|
In reply to this post by stace swayne
What is the syntax you are having problems with. From: SPSSX(r) Discussion
[mailto:[hidden email]] On Behalf Of stace swayne Dear list, I have a string variable called "semester taken"
(f/2003, f2004, f2005, f2006 etc.), I would like to select years f/2004 and
later, but I'm having trouble getting spss to do this. Is it because this is a
string variable? All suggestions are appreciated, Stace |
|
In reply to this post by Chipulu M.
At 05:26 AM 4/7/2009, Chipulu M. wrote:
>I am trying to calculate a spearman correlation matrix with 259 >variables. However, this number exceeds the 100 allowed. Marta's given you one good solution. I'd use a highly low-tech solution. (Code not tested): NONPAR CORR VARIABLES = V1 TO V100. NONPAR CORR VARIABLES = V1 TO V100 WITH V101 TO V259. NONPAR CORR VARIABLES = V101 TO V259. I think this covers all pairs. It does take two more data passes. I'm not sure how that compares with Marta's MATRIX solution. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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 |
|
In reply to this post by ViAnn Beadle
Dear Stace,
I hope that you know for doing a data selection, you will need to click on data-->select cases on your software. if you place the condition as semester_taken (I hope this is how the variable name is spelt) as the following in the condition box, an error will be generated. semester_taken=f2004 (wrong version) The correct version should be as follows. semester_taken='f2004' (correct version) For string variable, the value will need to be in single or double quotes. I hope that helps. If not, you will need to provide more details of your problems. Cheers Dorraj Date: Tue, 7 Apr 2009 09:18:03 -0600 From: [hidden email] Subject: Re: question about selecting string variables To: [hidden email] What is the syntax you are having problems with.
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of stace swayne
Dear list,
I have a string variable called "semester taken" (f/2003, f2004, f2005, f2006 etc.), I would like to select years f/2004 and later, but I'm having trouble getting spss to do this. Is it because this is a string variable?
All suggestions are appreciated,
Stace
Make the most of what you can do on your PC and the Web, just the way you want. Windows Live |
|
In reply to this post by Richard Ristow
Thanks Richard and Marta: Marta's solution worked very well!
Max ________________________________________ From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Richard Ristow [[hidden email]] Sent: 07 April 2009 19:05 To: [hidden email] Subject: Re: 259 Variable problem: How to calculate Spearman's correlation At 05:26 AM 4/7/2009, Chipulu M. wrote: >I am trying to calculate a spearman correlation matrix with 259 >variables. However, this number exceeds the 100 allowed. Marta's given you one good solution. I'd use a highly low-tech solution. (Code not tested): NONPAR CORR VARIABLES = V1 TO V100. NONPAR CORR VARIABLES = V1 TO V100 WITH V101 TO V259. NONPAR CORR VARIABLES = V101 TO V259. I think this covers all pairs. It does take two more data passes. I'm not sure how that compares with Marta's MATRIX solution. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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 [hidden email] (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 |
|
In reply to this post by Richard Ristow
Richard Ristow wrote:
> I am trying to calculate a spearman correlation matrix with 259 > variables. However, this number exceeds the 100 allowed. > > Marta's given you one good solution. I'd use a highly low-tech > solution. (Code not tested): > > NONPAR CORR VARIABLES = V1 TO V100. > NONPAR CORR VARIABLES = V1 TO V100 WITH V101 TO V259. > NONPAR CORR VARIABLES = V101 TO V259. Hi Richard: It seemed a good idea, but it doesn't work (your second NONPAR CORR had to be split in two, BTW): NONPAR CORR VARIABLES = x1 TO x100. NONPAR CORR VARIABLES = x101 TO x200. NONPAR CORR VARIABLES = x201 TO x259. NONPAR CORR VARIABLES = x1 TO x100 WITH x101 TO x200. NONPAR CORR VARIABLES = x1 TO x100 WITH x201 TO x259. NONPAR CORR VARIABLES = x101 TO x200 WITH x201 TO x259. The first 3 are OK, but the fourth triggers the same message (since 200 different variables are involved). It runs OK (tested) if we work with 50-variables chunks (to involve 50+50=100 variables every time): NONPAR CORR VARIABLES = x1 TO x50 WITH x101 TO x150. NONPAR CORR VARIABLES = x1 TO x50 WITH x151 TO x200. NONPAR CORR VARIABLES = x1 TO x50 WITH x201 TO x250. NONPAR CORR VARIABLES = x1 TO x50 WITH x251 TO x259. NONPAR CORR VARIABLES = x51 TO x100 WITH x101 TO x150. NONPAR CORR VARIABLES = x51 TO x100 WITH x151 TO x200. NONPAR CORR VARIABLES = x51 TO x100 WITH x201 TO x250. NONPAR CORR VARIABLES = x51 TO x100 WITH x251 TO x259. and so on... Best regards, Marta -- For miscellaneous statistical stuff, visit: http://gjyp.nl/marta/ ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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 |
|
At 03:25 AM 4/8/2009, Marta García-Granero wrote:
>Richard Ristow wrote: >> >>I'd use a highly low-tech solution. (Code not tested): >> >>NONPAR CORR VARIABLES = V1 TO V100. >>NONPAR CORR VARIABLES = V1 TO V100 WITH V101 TO V259. >>NONPAR CORR VARIABLES = V101 TO V259. > >It seemed a good idea, but it doesn't work (your second NONPAR CORR had >to be split in two, BTW): > >NONPAR CORR VARIABLES = x1 TO x100. >NONPAR CORR VARIABLES = x101 TO x200. >NONPAR CORR VARIABLES = x201 TO x259. >NONPAR CORR VARIABLES = x1 TO x100 WITH x101 TO x200. >NONPAR CORR VARIABLES = x1 TO x100 WITH x201 TO x259. >NONPAR CORR VARIABLES = x101 TO x200 WITH x201 TO x259. > >The first 3 are OK, but the fourth triggers the >same message (since 200 different variables are involved). > >It runs OK (tested) if we work with 50-variables >chunks (to involve 50+50=100 variables every time): Thank you, Marta. And apologies. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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 |
| Free forum by Nabble | Edit this page |
