|
I thought that SPSS 16 was supposed to handle missing values in *string
*variables. However, I get this error when I run the syntax below. >Error # 4310 in column 26. Text: ) >The *numeric* argument required for the function specified was not supplied. >This command not executed. new file. data list list/ id(a3) latcod(a10) loncod(a10). begin data '001' '033232620' '-087582480' '002' '041650330' '-081367290' '003' 'N ' 'N ' '004' 'M ' 'M ' end data. missing values LATCOD LONCOD('M', 'N'). numeric Latitude Longitude (f12.6). compute latitude = 999. compute longitude= 999. do if nmiss(LATCOD,LONCOD) eq 0. compute latitude = number(latcod, f12.6). compute longitude = number(loncod, f12.6). end if. var labels Latitude 'latitude in decimal degrees' Longitude 'longitude in decimal degrees'. missing values Latitude Longitude (999). list. I get the same message if I use do if nvalid(LATCOD,LONCOD) eq 2. I can work around this by having the do if condition explicitly test for the string values that I want treated as missing. Am I missing something obvious? (Not enough or too much coffee?) Am I misreading the help? Art Kendall Social Research Consultants ===================== 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 |
|
From the CSR:
With the exception of the MISSING function, only numeric values can be used as arguments in missing-value functions. The reason for this has to do with the MISSING function requiring a variable name while the other missing value functions accept general expressions. HTH, Jon Peck -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall Sent: Tuesday, June 17, 2008 9:08 AM To: [hidden email] Subject: [SPSSX-L] NMISS function in SPSS 16. I thought that SPSS 16 was supposed to handle missing values in *string *variables. However, I get this error when I run the syntax below. >Error # 4310 in column 26. Text: ) >The *numeric* argument required for the function specified was not supplied. >This command not executed. new file. data list list/ id(a3) latcod(a10) loncod(a10). begin data '001' '033232620' '-087582480' '002' '041650330' '-081367290' '003' 'N ' 'N ' '004' 'M ' 'M ' end data. missing values LATCOD LONCOD('M', 'N'). numeric Latitude Longitude (f12.6). compute latitude = 999. compute longitude= 999. do if nmiss(LATCOD,LONCOD) eq 0. compute latitude = number(latcod, f12.6). compute longitude = number(loncod, f12.6). end if. var labels Latitude 'latitude in decimal degrees' Longitude 'longitude in decimal degrees'. missing values Latitude Longitude (999). list. I get the same message if I use do if nvalid(LATCOD,LONCOD) eq 2. I can work around this by having the do if condition explicitly test for the string values that I want treated as missing. Am I missing something obvious? (Not enough or too much coffee?) Am I misreading the help? Art Kendall Social Research Consultants ===================== 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 Art Kendall
The only enhancement for missing values in SPSS 16 is the ability to define missing values for long string variables -- but the values defined as missing are restricted to 8 bytes.
-----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall Sent: Tuesday, June 17, 2008 10:08 AM To: [hidden email] Subject: NMISS function in SPSS 16. I thought that SPSS 16 was supposed to handle missing values in *string *variables. However, I get this error when I run the syntax below. >Error # 4310 in column 26. Text: ) >The *numeric* argument required for the function specified was not supplied. >This command not executed. new file. data list list/ id(a3) latcod(a10) loncod(a10). begin data '001' '033232620' '-087582480' '002' '041650330' '-081367290' '003' 'N ' 'N ' '004' 'M ' 'M ' end data. missing values LATCOD LONCOD('M', 'N'). numeric Latitude Longitude (f12.6). compute latitude = 999. compute longitude= 999. do if nmiss(LATCOD,LONCOD) eq 0. compute latitude = number(latcod, f12.6). compute longitude = number(loncod, f12.6). end if. var labels Latitude 'latitude in decimal degrees' Longitude 'longitude in decimal degrees'. missing values Latitude Longitude (999). list. I get the same message if I use do if nvalid(LATCOD,LONCOD) eq 2. I can work around this by having the do if condition explicitly test for the string values that I want treated as missing. Am I missing something obvious? (Not enough or too much coffee?) Am I misreading the help? Art Kendall Social Research Consultants ===================== 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 Art Kendall
Someone asked me offline what my workaround was, and if it works on
earlier versions. I don't have earlier versions up to test it, but I think it would since this is what we had to do before long strings could have missing values. this is the workaround syntax. new file. data list list/ id(a3) latcod(a10) loncod(a10). begin data '001' '033232620' '-087582480' '002' '041650330' '-081367290' '003' 'N ' 'N ' '004' 'M ' 'M ' end data. missing values LATCOD LONCOD('M', 'N'). numeric Latitude Longitude (f12.6). if loncod eq 'M' latitude = 999. if latcod eq 'M' longitude = 999. if loncod eq 'N' latitude = 998. if latcod eq 'N' longitude = 998. do if not any(latcod,'M','N') and not any(loncod,'M','N'). compute latitude = number(latcod, f12.6). compute longitude = number(loncod, f12.6). end if. var labels Latitude 'latitude in decimal degrees' Longitude 'longitude in decimal degrees'. missing values Latitude Longitude (998,999). value labels latitude longitude 998 'n/a' 999 'data missing'. list. Art Art Kendall wrote: > I thought that SPSS 16 was supposed to handle missing values in *string > *variables. > However, I get this error when I run the syntax below. > > >Error # 4310 in column 26. Text: ) > >The *numeric* argument required for the function specified was not > supplied. > >This command not executed. > > > new file. > data list list/ id(a3) latcod(a10) loncod(a10). > begin data > '001' '033232620' '-087582480' > '002' '041650330' '-081367290' > '003' 'N ' 'N ' > '004' 'M ' 'M ' > end data. > > missing values LATCOD LONCOD('M', 'N'). > numeric Latitude Longitude (f12.6). > compute latitude = 999. > compute longitude= 999. > do if nmiss(LATCOD,LONCOD) eq 0. > compute latitude = number(latcod, f12.6). > compute longitude = number(loncod, f12.6). > end if. > var labels Latitude 'latitude in decimal degrees' > Longitude 'longitude in decimal degrees'. > missing values Latitude Longitude (999). > list. > > > > I get the same message if I use > do if nvalid(LATCOD,LONCOD) eq 2. > > I can work around this by having the do if condition explicitly test for > the string values that I want treated as missing. > > Am I missing something obvious? (Not enough or too much coffee?) > Am I misreading the help? > > > Art Kendall > Social Research Consultants > > ===================== > 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 |
|
In reply to this post by Oliver, Richard
In my example, the values defined as missing are one byte.
Art Oliver, Richard wrote: > The only enhancement for missing values in SPSS 16 is the ability to define missing values for long string variables -- but the values defined as missing are restricted to 8 bytes. > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall > Sent: Tuesday, June 17, 2008 10:08 AM > To: [hidden email] > Subject: NMISS function in SPSS 16. > > I thought that SPSS 16 was supposed to handle missing values in *string > *variables. > However, I get this error when I run the syntax below. > > >Error # 4310 in column 26. Text: ) > >The *numeric* argument required for the function specified was not > supplied. > >This command not executed. > > > new file. > data list list/ id(a3) latcod(a10) loncod(a10). > begin data > '001' '033232620' '-087582480' > '002' '041650330' '-081367290' > '003' 'N ' 'N ' > '004' 'M ' 'M ' > end data. > > missing values LATCOD LONCOD('M', 'N'). > numeric Latitude Longitude (f12.6). > compute latitude = 999. > compute longitude= 999. > do if nmiss(LATCOD,LONCOD) eq 0. > compute latitude = number(latcod, f12.6). > compute longitude = number(loncod, f12.6). > end if. > var labels Latitude 'latitude in decimal degrees' > Longitude 'longitude in decimal degrees'. > missing values Latitude Longitude (999). > list. > > > > I get the same message if I use > do if nvalid(LATCOD,LONCOD) eq 2. > > I can work around this by having the do if condition explicitly test for > the string values that I want treated as missing. > > Am I missing something obvious? (Not enough or too much coffee?) > Am I misreading the help? > > > Art Kendall > Social Research Consultants > > ===================== > 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 > > > ===================== 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 |
|
In reply to this post by Peck, Jon
Sorry for the post, I should have done more than use the <help> command.
Art Peck, Jon wrote: > From the CSR: > > With the exception of the MISSING function, only numeric values can be used as arguments in > missing-value functions. > > The reason for this has to do with the MISSING function requiring a variable name while the other missing value functions accept general expressions. > > HTH, > Jon Peck > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall > Sent: Tuesday, June 17, 2008 9:08 AM > To: [hidden email] > Subject: [SPSSX-L] NMISS function in SPSS 16. > > I thought that SPSS 16 was supposed to handle missing values in *string > *variables. > However, I get this error when I run the syntax below. > > >Error # 4310 in column 26. Text: ) > >The *numeric* argument required for the function specified was not > supplied. > >This command not executed. > > > new file. > data list list/ id(a3) latcod(a10) loncod(a10). > begin data > '001' '033232620' '-087582480' > '002' '041650330' '-081367290' > '003' 'N ' 'N ' > '004' 'M ' 'M ' > end data. > > missing values LATCOD LONCOD('M', 'N'). > numeric Latitude Longitude (f12.6). > compute latitude = 999. > compute longitude= 999. > do if nmiss(LATCOD,LONCOD) eq 0. > compute latitude = number(latcod, f12.6). > compute longitude = number(loncod, f12.6). > end if. > var labels Latitude 'latitude in decimal degrees' > Longitude 'longitude in decimal degrees'. > missing values Latitude Longitude (999). > list. > > > > I get the same message if I use > do if nvalid(LATCOD,LONCOD) eq 2. > > I can work around this by having the do if condition explicitly test for > the string values that I want treated as missing. > > Am I missing something obvious? (Not enough or too much coffee?) > Am I misreading the help? > > > Art Kendall > Social Research Consultants > > ===================== > 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 |
|
In reply to this post by Art Kendall
I'm sorry. I was somewhat vague. My point was that the only enhancement introduced in version 16 for missing values in string variables was to allow long string variables to have user-defined missing values. We didn't change the behavior of any existing functions to provide additional support for string variables.
-----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall Sent: Tuesday, June 17, 2008 10:31 AM To: [hidden email] Subject: Re: NMISS function in SPSS 16. In my example, the values defined as missing are one byte. Art Oliver, Richard wrote: > The only enhancement for missing values in SPSS 16 is the ability to define missing values for long string variables -- but the values defined as missing are restricted to 8 bytes. > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall > Sent: Tuesday, June 17, 2008 10:08 AM > To: [hidden email] > Subject: NMISS function in SPSS 16. > > I thought that SPSS 16 was supposed to handle missing values in *string > *variables. > However, I get this error when I run the syntax below. > > >Error # 4310 in column 26. Text: ) > >The *numeric* argument required for the function specified was not > supplied. > >This command not executed. > > > new file. > data list list/ id(a3) latcod(a10) loncod(a10). > begin data > '001' '033232620' '-087582480' > '002' '041650330' '-081367290' > '003' 'N ' 'N ' > '004' 'M ' 'M ' > end data. > > missing values LATCOD LONCOD('M', 'N'). > numeric Latitude Longitude (f12.6). > compute latitude = 999. > compute longitude= 999. > do if nmiss(LATCOD,LONCOD) eq 0. > compute latitude = number(latcod, f12.6). > compute longitude = number(loncod, f12.6). > end if. > var labels Latitude 'latitude in decimal degrees' > Longitude 'longitude in decimal degrees'. > missing values Latitude Longitude (999). > list. > > > > I get the same message if I use > do if nvalid(LATCOD,LONCOD) eq 2. > > I can work around this by having the do if condition explicitly test for > the string values that I want treated as missing. > > Am I missing something obvious? (Not enough or too much coffee?) > Am I misreading the help? > > > Art Kendall > Social Research Consultants > > ===================== > 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 > > > ===================== 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 |
|
Enhancing the missing data functions would be a good idea for the next
version. Art Oliver, Richard wrote: > I'm sorry. I was somewhat vague. My point was that the only enhancement introduced in version 16 for missing values in string variables was to allow long string variables to have user-defined missing values. We didn't change the behavior of any existing functions to provide additional support for string variables. > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall > Sent: Tuesday, June 17, 2008 10:31 AM > To: [hidden email] > Subject: Re: NMISS function in SPSS 16. > > In my example, the values defined as missing are one byte. > > Art > > Oliver, Richard wrote: > >> The only enhancement for missing values in SPSS 16 is the ability to define missing values for long string variables -- but the values defined as missing are restricted to 8 bytes. >> >> -----Original Message----- >> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall >> Sent: Tuesday, June 17, 2008 10:08 AM >> To: [hidden email] >> Subject: NMISS function in SPSS 16. >> >> I thought that SPSS 16 was supposed to handle missing values in *string >> *variables. >> However, I get this error when I run the syntax below. >> >> >Error # 4310 in column 26. Text: ) >> >The *numeric* argument required for the function specified was not >> supplied. >> >This command not executed. >> >> >> new file. >> data list list/ id(a3) latcod(a10) loncod(a10). >> begin data >> '001' '033232620' '-087582480' >> '002' '041650330' '-081367290' >> '003' 'N ' 'N ' >> '004' 'M ' 'M ' >> end data. >> >> missing values LATCOD LONCOD('M', 'N'). >> numeric Latitude Longitude (f12.6). >> compute latitude = 999. >> compute longitude= 999. >> do if nmiss(LATCOD,LONCOD) eq 0. >> compute latitude = number(latcod, f12.6). >> compute longitude = number(loncod, f12.6). >> end if. >> var labels Latitude 'latitude in decimal degrees' >> Longitude 'longitude in decimal degrees'. >> missing values Latitude Longitude (999). >> list. >> >> >> >> I get the same message if I use >> do if nvalid(LATCOD,LONCOD) eq 2. >> >> I can work around this by having the do if condition explicitly test for >> the string values that I want treated as missing. >> >> Am I missing something obvious? (Not enough or too much coffee?) >> Am I misreading the help? >> >> >> Art Kendall >> Social Research Consultants >> >> ===================== >> 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 >> >> >> >> > > ===================== > 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 > > > ===================== 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 |
