True False converted to 1 0 without knowledge

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

True False converted to 1 0 without knowledge

Mark Webb-3
When opening an Excel file with True / False data SPSS automatically converts this to 1 & 0 and makes the variables numeric.
I find this a bit presumptuous - what if I want true/false in my data as a string variable !
Are there any other word combinations that are changes automatically without a warning ?

Regards
Mark Webb
Reply | Threaded
Open this post in threaded view
|

Re: True False converted to 1 0 without knowledge

Peck, Jon
Excel cell values have one of 5 fundamental types: number, text, logical value, error value, and array.  SPSS variable values are either numeric or string (plus SYSMIS).  Therefore, when you convert an Excel cell value to SPSS, Excel types have to be matched to SPSS types.  In Excel, if you convert TRUE to a number (N(TRUE)), you get 1.  If you convert it to text (=TEXT(TRUE,123)) you get the string "TRUE".

On top of this, the meaning of the value may have to be converted.  Dates in Excel are numbers, and dates in SPSS are numbers, but the meaning of the numbers is different, and SPSS converts accordingly using the format information for the cell.

So if you want different conversions for types that do not correspond, you can convert the cells on the Excel side or convert the variable on the SPSS side.

HTH,
Jon Peck

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark Webb
Sent: Wednesday, October 11, 2006 11:54 PM
To: [hidden email]
Subject: [SPSSX-L] True False converted to 1 0 without knowledge

When opening an Excel file with True / False data SPSS automatically converts this to 1 & 0 and makes the variables numeric.
I find this a bit presumptuous - what if I want true/false in my data as a string variable !
Are there any other word combinations that are changes automatically without a warning ?

Regards
Mark Webb