stuggling with strings

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

stuggling with strings

parisec
Hi all,

We received a file that originated in Excel that contains a bunch of long string variables which means declaring missing values is not gonna happen. I didn't think this would be a problem but SPSS is reading blanks as values rather than reading these blanks as system missing which screws up the frequency computations.

Anyone know why this is going on and what the workaround is?



Thanks for your insights.
Carol
Reply | Threaded
Open this post in threaded view
|

Re: stuggling with strings

Beadle, ViAnn
There are no missing values for long strings whether user-defined or system-defined. Try Autorecode to make your long strings into numbers and then declare the number assigned to the blank string as missing.

________________________________

From: SPSSX(r) Discussion on behalf of Parise, Carol A.
Sent: Thu 9/21/2006 6:56 PM
To: [hidden email]
Subject: stuggling with strings



Hi all,

We received a file that originated in Excel that contains a bunch of long string variables which means declaring missing values is not gonna happen. I didn't think this would be a problem but SPSS is reading blanks as values rather than reading these blanks as system missing which screws up the frequency computations.

Anyone know why this is going on and what the workaround is?



Thanks for your insights.
Carol
Reply | Threaded
Open this post in threaded view
|

Re: stuggling with strings

statisticsdoc
In reply to this post by parisec
Stephen Brand
www.statisticsdoc.com

Carol,

You can declare a missing value for a string variable as follows.  Suppose
fname and lname are string variables:

missing values fname lname ("   ") .

will result in fname and lname being treated as missing in frequencies.

A good site to read up on this is:
http://www.ats.ucla.edu/stat/spss/faq/countstr.htm

HTH,

Stephen Brand

For personalized and professional consultation in statistics and research
design, visit
www.statisticsdoc.com


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]]On Behalf Of
Parise, Carol A.
Sent: Thursday, September 21, 2006 7:56 PM
To: [hidden email]
Subject: stuggling with strings


Hi all,

We received a file that originated in Excel that contains a bunch of long
string variables which means declaring missing values is not gonna happen. I
didn't think this would be a problem but SPSS is reading blanks as values
rather than reading these blanks as system missing which screws up the
frequency computations.

Anyone know why this is going on and what the workaround is?



Thanks for your insights.
Carol
Reply | Threaded
Open this post in threaded view
|

Re: stuggling with strings

statisticsdoc
In reply to this post by parisec
Stephen Brand
www.statisticsdoc.com

Carol,

As soon as I sent my previous message, I realized that you were asking about
long strings, which are a different animal, as you say.  My example applies
to names of 8 characters or less. My apologies.

Since you cannot declare a missing value for long strings, another approach
would be to run your frequencies procedure after a temporary select if.

temp.
select if (lname gt '      ' ).
freq var lname.

HTH,

Stephen Brand

For personalized and professional consultation in statistics and research
design, visit
www.statisticsdoc.com


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]]On Behalf Of
Parise, Carol A.
Sent: Thursday, September 21, 2006 7:56 PM
To: [hidden email]
Subject: stuggling with strings


Hi all,

We received a file that originated in Excel that contains a bunch of long
string variables which means declaring missing values is not gonna happen. I
didn't think this would be a problem but SPSS is reading blanks as values
rather than reading these blanks as system missing which screws up the
frequency computations.

Anyone know why this is going on and what the workaround is?



Thanks for your insights.
Carol
Reply | Threaded
Open this post in threaded view
|

Re: stuggling with strings

Oliver, Richard
In reply to this post by Beadle, ViAnn
In SPSS 14 or later, you can automatically recode blanks into user-missing values with Autorecode (and Autorecode retains the original string values as value labels for non-blank values):
 

autorecode longstring /into numvar /blank=missing.


________________________________

From: SPSSX(r) Discussion on behalf of Beadle, ViAnn
Sent: Thu 9/21/2006 7:34 PM
To: [hidden email]
Subject: Re: stuggling with strings



There are no missing values for long strings whether user-defined or system-defined. Try Autorecode to make your long strings into numbers and then declare the number assigned to the blank string as missing.

________________________________

From: SPSSX(r) Discussion on behalf of Parise, Carol A.
Sent: Thu 9/21/2006 6:56 PM
To: [hidden email]
Subject: stuggling with strings



Hi all,

We received a file that originated in Excel that contains a bunch of long string variables which means declaring missing values is not gonna happen. I didn't think this would be a problem but SPSS is reading blanks as values rather than reading these blanks as system missing which screws up the frequency computations.

Anyone know why this is going on and what the workaround is?



Thanks for your insights.
Carol
Reply | Threaded
Open this post in threaded view
|

Re: stuggling with strings

Manmit Shrimali-2
In reply to this post by parisec
Hello Carol,

Just a note that sometimes using select if function under temp does not
work and so with count function. Using autorecode is also a safe method
along with reducing the length of string variable and then declare the
missing. For e.g

Var format (a8) * This will reduce the variable to short string.
Missing values varname (missing value)

Regards,

Manmit




-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Statisticsdoc
Sent: Friday, September 22, 2006 6:23 AM
To: [hidden email]
Subject: Re: stuggling with strings

Stephen Brand
www.statisticsdoc.com

Carol,

As soon as I sent my previous message, I realized that you were asking
about
long strings, which are a different animal, as you say.  My example
applies
to names of 8 characters or less. My apologies.

Since you cannot declare a missing value for long strings, another
approach
would be to run your frequencies procedure after a temporary select if.

temp.
select if (lname gt '      ' ).
freq var lname.

HTH,

Stephen Brand

For personalized and professional consultation in statistics and
research
design, visit
www.statisticsdoc.com


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]]On Behalf Of
Parise, Carol A.
Sent: Thursday, September 21, 2006 7:56 PM
To: [hidden email]
Subject: stuggling with strings


Hi all,

We received a file that originated in Excel that contains a bunch of
long
string variables which means declaring missing values is not gonna
happen. I
didn't think this would be a problem but SPSS is reading blanks as
values
rather than reading these blanks as system missing which screws up the
frequency computations.

Anyone know why this is going on and what the workaround is?



Thanks for your insights.
Carol
Reply | Threaded
Open this post in threaded view
|

Re: stuggling with strings

Shorful Islam
In reply to this post by parisec
Hi

Have you tried recode into same variable

There you can specify system or user missing as system missing

Hope that helps

Shorful


On 9/22/06, Parise, Carol A. <[hidden email]> wrote:

>
> Hi all,
>
> We received a file that originated in Excel that contains a bunch of long
> string variables which means declaring missing values is not gonna happen. I
> didn't think this would be a problem but SPSS is reading blanks as values
> rather than reading these blanks as system missing which screws up the
> frequency computations.
>
> Anyone know why this is going on and what the workaround is?
>
>
>
> Thanks for your insights.
> Carol
>
Reply | Threaded
Open this post in threaded view
|

Re: stuggling with strings

parisec
In reply to this post by parisec
woah! i never used autorecode before. I just tried it on this data set and it worked perfectly. that is one great command that i know i'll be using again.
 
thanks to all who replied.
 
Carol

-----Original Message-----
From: Beadle, ViAnn [mailto:[hidden email]]
Sent: Thursday, September 21, 2006 5:35 PM
To: Parise, Carol A.; [hidden email]
Subject: RE: stuggling with strings


There are no missing values for long strings whether user-defined or system-defined. Try Autorecode to make your long strings into numbers and then declare the number assigned to the blank string as missing.

  _____  

From: SPSSX(r) Discussion on behalf of Parise, Carol A.
Sent: Thu 9/21/2006 6:56 PM
To: [hidden email]
Subject: stuggling with strings



Hi all,

We received a file that originated in Excel that contains a bunch of long string variables which means declaring missing values is not gonna happen. I didn't think this would be a problem but SPSS is reading blanks as values rather than reading these blanks as system missing which screws up the frequency computations.

Anyone know why this is going on and what the workaround is?



Thanks for your insights.
Carol