|
Hi All,
I'm using hte Autorecode function with the grouped command but am find some strange behaviour. I have 5 string variables that i want to recode using the same scheme in each, When i run a freq on the new vars i see that many of the variables now have things like ?gcl ?bra ?pro ?ori or --- These are not in the original variables? Does anyone have an ideas of why this is happening? Cheers Mike (i'm using python to do this dynamically, as the number of str vars may change - though i don't think thats the source of my problem) MExposure =5 Nat_type1 = ["naturalsearchterm_last"] Nat_type2 = ['naturalsearchterm_last%i' % ele for ele in range(2,MExposure+1)] Nat_list = " ".join(Nat_type1 + Nat_type2) Nsearch1 = ['Nsearch_last'] Nsearch2 = ['Nsearch_last%i' % ele for ele in range(2,MExposure+1)] Nsearch_list = " ".join(Nsearch1 + Nsearch2) autorecode_Nat = """AUTORECODE VARIABLES= %s /INTO %s /GROUP.""" %(Nat_list,Nsearch_list) spss.Submit(autorecode_Nat) Which translates to the code to be submitted as AUTORECODE VARIABLES= naturalsearchterm_last naturalsearchterm_last2 naturalsearchterm_last3 naturalsearchterm_last4 naturalsearchterm_last5 /INTO Nsearch_last Nsearch_last2 Nsearch_last3 Nsearch_last4 Nsearch_last5 /GROUP. -- Michael Pearmain Senior Statistical Analyst 1st Floor, 180 Great Portland St. London W1W 5QZ t +44 (0) 2032191684 [hidden email] [hidden email] Doubleclick is a part of the Google group of companies ===================== 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 Jon,
The the autorecode function performed, but in the labels these extra characters were entered? when i compared the variable i was recoding and the new variable the values didn't match up in the frequency counts? If i autorecoded without the /grouped it performed as expected without the extra characters in the new variable. I was wanting to use \grouped as i want to use the any function later across the vars for further analysis Cheers Mike On Thu, Apr 17, 2008 at 4:33 PM, Peck, Jon <[hidden email]> wrote: > Michael, > > AUTORECODE produces numeric variables, but your output doesn't look like > it is numeric. Are the properties of the new variables correct? > > Regards, > Jon > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of > Michael Pearmain > Sent: Wednesday, April 16, 2008 6:12 AM > To: [hidden email] > Subject: [SPSSX-L] Strange behavious using Autorecode grouped > > Hi All, > > I'm using hte Autorecode function with the grouped command but am find > some > strange behaviour. > > I have 5 string variables that i want to recode using the same scheme in > each, > When i run a freq on the new vars i see that many of the variables now > have > things like ?gcl ?bra ?pro ?ori or --- > > These are not in the original variables? > > Does anyone have an ideas of why this is happening? > > Cheers > > Mike > > (i'm using python to do this dynamically, as the number of str vars may > change - though i don't think thats the source of my problem) > > MExposure =5 > Nat_type1 = ["naturalsearchterm_last"] > Nat_type2 = ['naturalsearchterm_last%i' % ele for ele in > range(2,MExposure+1)] > Nat_list = " ".join(Nat_type1 + Nat_type2) > Nsearch1 = ['Nsearch_last'] > Nsearch2 = ['Nsearch_last%i' % ele for ele in range(2,MExposure+1)] > Nsearch_list = " ".join(Nsearch1 + Nsearch2) > > autorecode_Nat = """AUTORECODE VARIABLES= %s > /INTO %s > /GROUP.""" %(Nat_list,Nsearch_list) > spss.Submit(autorecode_Nat) > > Which translates to the code to be submitted as > AUTORECODE VARIABLES= naturalsearchterm_last naturalsearchterm_last2 > naturalsearchterm_last3 naturalsearchterm_last4 naturalsearchterm_last5 > /INTO Nsearch_last Nsearch_last2 Nsearch_last3 Nsearch_last4 > Nsearch_last5 > /GROUP. > > -- > Michael Pearmain > Senior Statistical Analyst > > > 1st Floor, 180 Great Portland St. London W1W 5QZ > t +44 (0) 2032191684 > [hidden email] > [hidden email] > > > Doubleclick is a part of the Google group of companies > > ===================== > 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 > -- Michael Pearmain Senior Statistical Analyst 1st Floor, 180 Great Portland St. London W1W 5QZ t +44 (0) 2032191684 [hidden email] [hidden email] Doubleclick is a part of the Google group of companies ===================== 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 |
|
Would you create a small example that illustrates the problem?
this syntax worked for me. data list list/ word1 (a10)word2(a11) word3(a12). begin data 'cherry' 'bell' 'bar' 'bell' 'cherry' 'bell' 'orange' 'bar' 'cherry' 'bell' 'bar' 'lemon' end data. autorecode vars = word1 to word3 /into num1 to num3 /group. display dictionary vars = num1 to num3. frequencies vars= word1 to num3. Art Kendall Social Research Consultants Michael Pearmain wrote: > Hi Jon, > > The the autorecode function performed, but in the labels these extra > characters were entered? > when i compared the variable i was recoding and the new variable the values > didn't match up in the frequency counts? > > If i autorecoded without the /grouped it performed as expected without the > extra characters in the new variable. > > I was wanting to use \grouped as i want to use the any function later across > the vars for further analysis > > Cheers > > Mike > > > > On Thu, Apr 17, 2008 at 4:33 PM, Peck, Jon <[hidden email]> wrote: > > >> Michael, >> >> AUTORECODE produces numeric variables, but your output doesn't look like >> it is numeric. Are the properties of the new variables correct? >> >> Regards, >> Jon >> >> -----Original Message----- >> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of >> Michael Pearmain >> Sent: Wednesday, April 16, 2008 6:12 AM >> To: [hidden email] >> Subject: [SPSSX-L] Strange behavious using Autorecode grouped >> >> Hi All, >> >> I'm using hte Autorecode function with the grouped command but am find >> some >> strange behaviour. >> >> I have 5 string variables that i want to recode using the same scheme in >> each, >> When i run a freq on the new vars i see that many of the variables now >> have >> things like ?gcl ?bra ?pro ?ori or --- >> >> These are not in the original variables? >> >> Does anyone have an ideas of why this is happening? >> >> Cheers >> >> Mike >> >> (i'm using python to do this dynamically, as the number of str vars may >> change - though i don't think thats the source of my problem) >> >> MExposure =5 >> Nat_type1 = ["naturalsearchterm_last"] >> Nat_type2 = ['naturalsearchterm_last%i' % ele for ele in >> range(2,MExposure+1)] >> Nat_list = " ".join(Nat_type1 + Nat_type2) >> Nsearch1 = ['Nsearch_last'] >> Nsearch2 = ['Nsearch_last%i' % ele for ele in range(2,MExposure+1)] >> Nsearch_list = " ".join(Nsearch1 + Nsearch2) >> >> autorecode_Nat = """AUTORECODE VARIABLES= %s >> /INTO %s >> /GROUP.""" %(Nat_list,Nsearch_list) >> spss.Submit(autorecode_Nat) >> >> Which translates to the code to be submitted as >> AUTORECODE VARIABLES= naturalsearchterm_last naturalsearchterm_last2 >> naturalsearchterm_last3 naturalsearchterm_last4 naturalsearchterm_last5 >> /INTO Nsearch_last Nsearch_last2 Nsearch_last3 Nsearch_last4 >> Nsearch_last5 >> /GROUP. >> >> -- >> Michael Pearmain >> Senior Statistical Analyst >> >> >> 1st Floor, 180 Great Portland St. London W1W 5QZ >> t +44 (0) 2032191684 >> [hidden email] >> [hidden email] >> >> >> Doubleclick is a part of the Google group of companies >> >> ===================== >> 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 >> >> > > > > -- > Michael Pearmain > Senior Statistical Analyst > > > 1st Floor, 180 Great Portland St. London W1W 5QZ > t +44 (0) 2032191684 > [hidden email] > [hidden email] > > > Doubleclick is a part of the Google group of companies > > ===================== > 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
Art Kendall
Social Research Consultants |
| Free forum by Nabble | Edit this page |
