Assumed string width in GET DATA / TYPE = TXT

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

Assumed string width in GET DATA / TYPE = TXT

Ruben Geert van den Berg
Dear all,
 
Today I read a .CSV file from the GUI and it seemed to go perfectly well. However, I discovered that one string variable had length 3 in my dataset but length 4 in the .CSV file. For some cases the last digit disappeared. This almost led to erroneous conclusions. In the (pasted) syntax the format is A3 but it should have been A4 of course.
 
Is this because the first case in the .CSV had only three digits on this variable? Is there an easy way (other than checking all string lengths in the .CSV source file) to prevent this from happening?
 
TIA!
 
Ruben



 





New Windows 7: Simplify what you do everyday. Find the right PC for you.
Reply | Threaded
Open this post in threaded view
|

Re: Assumed string width in GET DATA / TYPE = TXT

Maguin, Eugene
Ruben,

What version are you using? I think somebody, maybe me, complained about
this in 16 and spss posted a problem in their 'to-be-fixed' database.


>>Today I read a .CSV file from the GUI and it seemed to go perfectly well.
However, I discovered that one string variable had length 3 in my dataset
but length 4 in the .CSV file. For some cases the last digit disappeared.
This almost led to erroneous conclusions. In the (pasted) syntax the format
is A3 but it should have been A4 of course.

Is this because the first case in the .CSV had only three digits on this
variable? Is there an easy way (other than checking all string lengths in
the .CSV source file) to prevent this from happening?

TIA!

Ruben

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Assumed string width in GET DATA / TYPE = TXT

Ruben Geert van den Berg
Today was version 15 but since I've access to v.17 as well, I'll try tomorrow whether the same happens. I'm pretty sure that -indeed- the 4-digit value first occurs after the first 200 cases have been read.
 
Kind regards,
 
Ruben



 



 

> Date: Tue, 15 Dec 2009 10:30:12 -0500
> From: [hidden email]
> Subject: Re: Assumed string width in GET DATA / TYPE = TXT
> To: [hidden email]
>
> Ruben,
>
> What version are you using? I think somebody, maybe me, complained about
> this in 16 and spss posted a problem in their 'to-be-fixed' database.
>
>
> >>Today I read a .CSV file from the GUI and it seemed to go perfectly well.
> However, I discovered that one string variable had length 3 in my dataset
> but length 4 in the .CSV file. For some cases the last digit disappeared.
> This almost led to erroneous conclusions. In the (pasted) syntax the format
> is A3 but it should have been A4 of course.
>
> Is this because the first case in the .CSV had only three digits on this
> variable? Is there an easy way (other than checking all string lengths in
> the .CSV source file) to prevent this from happening?
>
> TIA!
>
> Ruben
>
> =====================
> 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


New Windows 7: Simplify what you do everyday. Find the right PC for you.
Reply | Threaded
Open this post in threaded view
|

Re: Assumed string width in GET DATA / TYPE = TXT

Rick Oliver-3
In reply to this post by Maguin, Eugene

The Text Wizard scans the first 200 cases to determine format, including string width -- or at least that's what it does in version 18.  In release 16 or later, one workaround is to set all strings to an arbitrary large width, then use ALTER TYPE to trim all strings to the width of longest value of that variables, as in:

alter type all (a=amin).


From: Gene Maguin <[hidden email]>
To: [hidden email]
Date: 12/15/2009 09:31 AM
Subject: Re: Assumed string width in GET DATA / TYPE = TXT
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Ruben,

What version are you using? I think somebody, maybe me, complained about
this in 16 and spss posted a problem in their 'to-be-fixed' database.


>>Today I read a .CSV file from the GUI and it seemed to go perfectly well.
However, I discovered that one string variable had length 3 in my dataset
but length 4 in the .CSV file. For some cases the last digit disappeared.
This almost led to erroneous conclusions. In the (pasted) syntax the format
is A3 but it should have been A4 of course.

Is this because the first case in the .CSV had only three digits on this
variable? Is there an easy way (other than checking all string lengths in
the .CSV source file) to prevent this from happening?

TIA!

Ruben

=====================
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


Reply | Threaded
Open this post in threaded view
|

Query: Estimating coefficients in logistic regression by maximising the weighted log-likelihood

Jamie Burnett-3-3
Normal dot (Rev02 January 2009)

Hi,

 

I would like to know how I go about using logistic regression in SPSS when I have Design (sample) weights (due to unequal probabilities of selection in my survey) and I want to take them into account when estimating the beta coefficients of my model. According to R. Groves and M. Couper ‘Nonresponse in Household Interview Surveys’ they talk about estimating the unknown parameters by maximising the weighted log-likelihood.

 

Can this be done in SPSS either through simply weighting the data (through Data>Weight cases) before running a binary logistic regression or do I need to use the Advanced Generalised Linear Model add-on and include the sample weight as a scale weight variable? Or do I need the add-on Complex Samples?

 

Any help greatly appreciated.

 

Many thanks

 

Jamie Burnett

 

Associate Director

Research Methods Centre, Ipsos MORI

T   +44 20 7347 3338

M  +44 (0) 77349 50026

E   [hidden email]

W <a href="blocked::blocked::http://www.ipsos-mori.com/" title="blocked::http://www.ipsos-mori.com/ http://www.ipsos-mori.com/"> www.ipsos-mori.com

Twitter: @IpsosMORI

79-81 Borough Road, London, SE1 1FY

 

 

 



================================================================================================
This e-mail and all attachments it may contain is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Ipsos MORI and its associated companies. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, printing, forwarding or copying of this e-mail is strictly prohibited. Please contact the sender if you have received this e-mail in error.

Market & Opinion Research International Ltd (trading as Ipsos MORI), Registered in England and Wales No. 948470, 79-81 Borough Road, London SE1 1FY, United Kingdom. VAT reg no. 443932151. Email: [hidden email]

================================================================================================
Reply | Threaded
Open this post in threaded view
|

Re: Assumed string width in GET DATA / TYPE = TXT

Ruben Geert van den Berg
In reply to this post by Rick Oliver-3
Dear Richard and others,
 
Thanks for pointing that out, I didn't even know the (a=amin) statement and for practical purposes it's an excellent workaround.
 
I do think that the command syntax reference should clearly warn that the assumed string lengths are based on the first 200 cases only, I didn't find this information under 'GET DATA'.
 
Kind regards,
 
Ruben



 



 

Date: Tue, 15 Dec 2009 10:14:57 -0600
From: [hidden email]
Subject: Re: Assumed string width in GET DATA / TYPE = TXT
To: [hidden email]


The Text Wizard scans the first 200 cases to determine format, including string width -- or at least that's what it does in version 18.  In release 16 or later, one workaround is to set all strings to an arbitrary large width, then use ALTER TYPE to trim all strings to the width of longest value of that variables, as in:

alter type all (a=amin).


From: Gene Maguin <[hidden email]>
To: [hidden email]
Date: 12/15/2009 09:31 AM
Subject: Re: Assumed string width in GET DATA / TYPE = TXT
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Ruben,

What version are you using? I think somebody, maybe me, complained about
this in 16 and spss posted a problem in their 'to-be-fixed' database.


>>Today I read a .CSV file from the GUI and it seemed to go perfectly well.
However, I discovered that one string variable had length 3 in my dataset
but length 4 in the .CSV file. For some cases the last digit disappeared.
This almost led to erroneous conclusions. In the (pasted) syntax the format
is A3 but it should have been A4 of course.

Is this because the first case in the .CSV had only three digits on this
variable? Is there an easy way (other than checking all string lengths in
the .CSV source file) to prevent this from happening?

TIA!

Ruben

=====================
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




Express yourself instantly with MSN Messenger! MSN Messenger