Problem with SPSS arithmetic

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

Problem with SPSS arithmetic

Sharp, Joe P.
I'm a rank newbie in this group and don't have much experience at all with SPSS. I've just come across this, and it bothers me a lot:

I'm doing a one-way ANOVA and estimating some contrasts. For one of these, I estimate the value of the contrast as ĉ = 2*( 4.6 + 4.4 + 4.8 ) – 3*( 2.1 + 2.1 ) = 27.6 - 12.6 = 15 (by hand).

SPSS gets ĉ = 14.4.

Now admittedly I'm pretty damn bad at arithmetic for someone with two degrees in math, but I've checked my hand calculations about six times.

Have any of you ever seen something like this?

Regards,

Joe S

=====================
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: Problem with SPSS arithmetic

Bruce Weaver
Administrator
Sharp, Joe P. wrote
I'm a rank newbie in this group and don't have much experience at all with SPSS. I've just come across this, and it bothers me a lot:

I'm doing a one-way ANOVA and estimating some contrasts. For one of these, I estimate the value of the contrast as ĉ = 2*( 4.6 + 4.4 + 4.8 ) – 3*( 2.1 + 2.1 ) = 27.6 - 12.6 = 15 (by hand).

SPSS gets ĉ = 14.4.

Now admittedly I'm pretty damn bad at arithmetic for someone with two degrees in math, but I've checked my hand calculations about six times.

Have any of you ever seen something like this?

Regards,

Joe S
Two possibilities come to mind:

1. You show the means to one decimal.  Are you introducing rounding error?
2. Are the sample sizes all equal?  If not, you may want to check the SPSS algorithms to see how it handles that.  (I don't know what the answer is, but I'd be checking to see if it changes things.)

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Problems with the 'SORT' menu

Mark A Davenport MADAVENP

All,

Has anybody here noticed a problem with the 'sort cases' menu?  If I have been using PASW for some time, having opened, closed many files and run several procedures, the software seems to get 'tired' of sorting.  I might pull up the sort cases menu and try a simple sort.  I can pull the variable over and all of the buttons (OK, Paste, Reset, Cancel, Help) appear--none of them greyed out.  I click on 'OK' and nothing happens.  The image of the button appears to get 'pushed in' like it should but it just stays there.  The menu box doesn't close and the sort does not occur.  In the same instances, the Paste button doesn't seem to work either.  However, the Reset, Cancel, and Help buttons do work.  If I write out a sort statement and run it in syntax, the sort runs fine.  Once this occurs, the sort menu is useless for any other dataset window until I close eveything and reopen PASW.  This strange behavior doesn't seem  to occur with any other PASW menu window, just Sort Cases.  It occurs with 17.0.2 networked on a  big Dell desktop and on an individual license of 18 on my Lenovo laptop.

Has anybody else seen this?  I don't recall seeing this in the betas of either version.

***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962)


Reply | Threaded
Open this post in threaded view
|

Re: Problems with the 'SORT' menu

Khaneja, Gurvinder

Marc

That’s correct Mark. It has been frustrating to deal with the sort function as it forces you to quit the program and start again.  Any resolutions on that????

Gurvinder Khaneja

 

Gurvinder Khaneja, Ed.D

Executive Director, Institutional Research and Planning

Passaic County Community College

Phone: 973.684.6741

Fax:      973.684.1925

[hidden email]

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark A Davenport MADAVENP
Sent: Friday, October 30, 2009 10:28 AM
To: [hidden email]
Subject: Problems with the 'SORT' menu

 


All,

Has anybody here noticed a problem with the 'sort cases' menu?  If I have been using PASW for some time, having opened, closed many files and run several procedures, the software seems to get 'tired' of sorting.  I might pull up the sort cases menu and try a simple sort.  I can pull the variable over and all of the buttons (OK, Paste, Reset, Cancel, Help) appear--none of them greyed out.  I click on 'OK' and nothing happens.  The image of the button appears to get 'pushed in' like it should but it just stays there.  The menu box doesn't close and the sort does not occur.  In the same instances, the Paste button doesn't seem to work either.  However, the Reset, Cancel, and Help buttons do work.  If I write out a sort statement and run it in syntax, the sort runs fine.  Once this occurs, the sort menu is useless for any other dataset window until I close eveything and reopen PASW.  This strange behavior doesn't seem  to occur with any other PASW menu window, just Sort Cases.  It occurs with 17.0.2 networked on a  big Dell desktop and on an individual license of 18 on my Lenovo laptop.

Has anybody else seen this?  I don't recall seeing this in the betas of either version.

***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962)

Reply | Threaded
Open this post in threaded view
|

Re: Problems with the 'SORT' menu

Lemon, John S.
In reply to this post by Mark A Davenport MADAVENP

Mark et al.

 

I noticed this a couple of times when beta testing 17 but it is extremely difficult to replicate; in fact every time I tried to re-create it I failed to provide a definitive set of commands / steps so I assumed it was something I was doing J

 

I think it is due to a combination of file size and sorts which hardly change the file – BUT – as I said trying to produce evidence and replicate it reliably proved to be too hard and life is too short. I just accepted that it happens and just shut down and restart.

 

Best Wishes

 

John S. Lemon

Student Liaison Officer

Directorate of Information Technology (DIT) - University of Aberdeen

Edward Wright Building: Room G51

 

Tel:  +44 1224 273350

Fax: +44 1224 273372

 

Diary ( Free / Busy )

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark A Davenport MADAVENP
Sent: 30 October 2009 14:28
To: [hidden email]
Subject: Problems with the 'SORT' menu

 


All,

Has anybody here noticed a problem with the 'sort cases' menu?  If I have been using PASW for some time, having opened, closed many files and run several procedures, the software seems to get 'tired' of sorting.  I might pull up the sort cases menu and try a simple sort.  I can pull the variable over and all of the buttons (OK, Paste, Reset, Cancel, Help) appear--none of them greyed out.  I click on 'OK' and nothing happens.  The image of the button appears to get 'pushed in' like it should but it just stays there.  The menu box doesn't close and the sort does not occur.  In the same instances, the Paste button doesn't seem to work either.  However, the Reset, Cancel, and Help buttons do work.  If I write out a sort statement and run it in syntax, the sort runs fine.  Once this occurs, the sort menu is useless for any other dataset window until I close eveything and reopen PASW.  This strange behavior doesn't seem  to occur with any other PASW menu window, just Sort Cases.  It occurs with 17.0.2 networked on a  big Dell desktop and on an individual license of 18 on my Lenovo laptop.

Has anybody else seen this?  I don't recall seeing this in the betas of either version.

***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962)



The University of Aberdeen is a charity registered in Scotland, No SC013683.
Reply | Threaded
Open this post in threaded view
|

Re: Problems with the 'SORT' menu

Mark A Davenport MADAVENP

I may work on a project for several hours and I often have multiple sets open done multiple merges so I use sort cases a lot.  A LOT!  But, often the sort does not produce large changes in the file.  So, you might be on to something.  Sadly, as I work on this particular yearly project, it becomes a significant issue.  I was getting it last year about the same time of  year (after beta testing was over).  It does seem to occur only when I have been 'abusing' data for extended periods.  As I abuse data with great regularity in the fall, I am having a pretty consistent problem with it now.

Thanks for the input.

***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962)





"Lemon, John S." <[hidden email]>

10/30/2009 10:36 AM

To
Mark A Davenport MADAVENP <[hidden email]>, "[hidden email]" <[hidden email]>
cc
Subject
RE: Problems with the 'SORT' menu





Mark et al.
 
I noticed this a couple of times when beta testing 17 but it is extremely difficult to replicate; in fact every time I tried to re-create it I failed to provide a definitive set of commands / steps so I assumed it was something I was doing J
 
I think it is due to a combination of file size and sorts which hardly change the file – BUT – as I said trying to produce evidence and replicate it reliably proved to be too hard and life is too short. I just accepted that it happens and just shut down and restart.
 
Best Wishes
 
John S. Lemon
Student Liaison Officer
Directorate of Information Technology (DIT) - University of Aberdeen
Edward Wright Building: Room G51
 
Tel:  +44 1224 273350
Fax: +44 1224 273372
 
Diary ( Free / Busy )
 
 
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark A Davenport MADAVENP
Sent:
30 October 2009 14:28
To:
[hidden email]
Subject:
Problems with the 'SORT' menu

 

All,


Has anybody here noticed a problem with the 'sort cases' menu?  If I have been using PASW for some time, having opened, closed many files and run several procedures, the software seems to get 'tired' of sorting.  I might pull up the sort cases menu and try a simple sort.  I can pull the variable over and all of the buttons (OK, Paste, Reset, Cancel, Help) appear--none of them greyed out.  I click on 'OK' and nothing happens.  The image of the button appears to get 'pushed in' like it should but it just stays there.  The menu box doesn't close and the sort does not occur.  In the same instances, the Paste button doesn't seem to work either.  However, the Reset, Cancel, and Help buttons do work.  If I write out a sort statement and run it in syntax, the sort runs fine.  Once this occurs, the sort menu is useless for any other dataset window until I close eveything and reopen PASW.  This strange behavior doesn't seem  to occur with any other PASW menu window, just Sort Cases.  It occurs with 17.0.2 networked on a  big Dell desktop and on an individual license of 18 on my Lenovo laptop.


Has anybody else seen this?  I don't recall seeing this in the betas of either version.


***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962)



The University of Aberdeen is a charity registered in Scotland, No SC013683.

Reply | Threaded
Open this post in threaded view
|

Re: Problems with the 'SORT' menu

ViAnn Beadle
In reply to this post by Mark A Davenport MADAVENP

What happens if you run the SORT using syntax?

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark A Davenport MADAVENP
Sent: Friday, October 30, 2009 8:28 AM
To: [hidden email]
Subject: Problems with the 'SORT' menu

 


All,

Has anybody here noticed a problem with the 'sort cases' menu?  If I have been using PASW for some time, having opened, closed many files and run several procedures, the software seems to get 'tired' of sorting.  I might pull up the sort cases menu and try a simple sort.  I can pull the variable over and all of the buttons (OK, Paste, Reset, Cancel, Help) appear--none of them greyed out.  I click on 'OK' and nothing happens.  The image of the button appears to get 'pushed in' like it should but it just stays there.  The menu box doesn't close and the sort does not occur.  In the same instances, the Paste button doesn't seem to work either.  However, the Reset, Cancel, and Help buttons do work.  If I write out a sort statement and run it in syntax, the sort runs fine.  Once this occurs, the sort menu is useless for any other dataset window until I close eveything and reopen PASW.  This strange behavior doesn't seem  to occur with any other PASW menu window, just Sort Cases.  It occurs with 17.0.2 networked on a  big Dell desktop and on an individual license of 18 on my Lenovo laptop.

Has anybody else seen this?  I don't recall seeing this in the betas of either version.

***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962)

Reply | Threaded
Open this post in threaded view
|

FW: Problem with SPSS arithmetic

Sharp, Joe P.
In reply to this post by Sharp, Joe P.
More info:

-- the individual data values are counts;
-- sample size = 5 for each treatment.

Roundoff error is not the problem.
________________________________________
From: Sharp, Joe P.
Sent: Friday, October 30, 2009 12:10 AM
To: [hidden email]
Subject: Problem with SPSS arithmetic

I'm a rank newbie in this group and don't have much experience at all with SPSS. I've just come across this, and it bothers me a lot:

I'm doing a one-way ANOVA and estimating some contrasts. For one of these, I estimate the value of the contrast as ĉ = 2*( 4.6 + 4.4 + 4.8 ) – 3*( 2.1 + 2.1 ) = 27.6 - 12.6 = 15 (by hand).

SPSS gets ĉ = 14.4.

Now admittedly I'm pretty damn bad at arithmetic for someone with two degrees in math, but I've checked my hand calculations about six times.

Have any of you ever seen something like this?

Regards,

Joe S

=====================
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: Problems with the 'SORT' menu

ViAnn Beadle
In reply to this post by ViAnn Beadle

Forwarding to the list. Sounds to me like there is a bug in the UI which persists settings from the last invocation of the dialog. At least users can get around this problem via syntax.

 

From: Mark A Davenport MADAVENP [mailto:[hidden email]]
Sent: Friday, October 30, 2009 9:34 AM
To: ViAnn Beadle
Subject: Re: Problems with the 'SORT' menu

 


If I write out a sort statement and run it in syntax, the sort runs fine.

***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962)




ViAnn Beadle <[hidden email]>
Sent by: "SPSSX(r) Discussion" <[hidden email]>

10/30/2009 11:28 AM

Please respond to
ViAnn Beadle <[hidden email]>

To

[hidden email]

cc

Subject

Re: Problems with the 'SORT' menu

 




What happens if you run the SORT using syntax?
 
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark A Davenport MADAVENP
Sent:
Friday, October 30, 2009 8:28 AM
To:
[hidden email]
Subject:
Problems with the 'SORT' menu

 

All,


Has anybody here noticed a problem with the 'sort cases' menu?  If I have been using PASW for some time, having opened, closed many files and run several procedures, the software seems to get 'tired' of sorting.  I might pull up the sort cases menu and try a simple sort.  I can pull the variable over and all of the buttons (OK, Paste, Reset, Cancel, Help) appear--none of them greyed out.  I click on 'OK' and nothing happens.  The image of the button appears to get 'pushed in' like it should but it just stays there.  The menu box doesn't close and the sort does not occur.  In the same instances, the Paste button doesn't seem to work either.  However, the Reset, Cancel, and Help buttons do work.  If I write out a sort statement and run it in syntax, the sort runs fine.  Once this occurs, the sort menu is useless for any other dataset window until I close eveything and reopen PASW.  This strange behavior doesn't seem  to occur with any other PASW menu window, just Sort Cases.  It occurs with 17.0.2 networked on a  big Dell desktop and on an individual license of 18 on my Lenovo laptop.


Has anybody else seen this?  I don't recall seeing this in the betas of either version.


***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962)

Reply | Threaded
Open this post in threaded view
|

Re: FW: Problem with SPSS arithmetic

Marta Garcia-Granero
In reply to this post by Sharp, Joe P.
Hi Joe


Sharp, Joe P. WROTE:
> More info:
>
> -- the individual data values are counts;
>

Do you mean they are integers?

> -- sample size = 5 for each treatment.
>

If the individual values are truly integers, then there is something
wrong with some of the means you report, like 2.1, since there is no way
you can get a mean with value 2.1 when you divide and integer value by 5.

HTH,
Marta GG

> Roundoff error is not the problem.
> ________________________________________
> From: Sharp, Joe P.
> Sent: Friday, October 30, 2009 12:10 AM
> To: [hidden email]
> Subject: Problem with SPSS arithmetic
>
> I'm a rank newbie in this group and don't have much experience at all with SPSS. I've just come across this, and it bothers me a lot:
>
> I'm doing a one-way ANOVA and estimating some contrasts. For one of these, I estimate the value of the contrast as ĉ = 2*( 4.6 + 4.4 + 4.8 ) – 3*( 2.1 + 2.1 ) = 27.6 - 12.6 = 15 (by hand).
>
> SPSS gets ĉ = 14.4.
>
> Now admittedly I'm pretty damn bad at arithmetic for someone with two degrees in math, but I've checked my hand calculations about six times.
>
> Have any of you ever seen something like this?
>
> Regards,
>
> Joe S
>
> =====================
> 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
>
>


--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/

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

Ver. 17.0.1 Date calculation error

Roberts, Michael
In reply to this post by Mark A Davenport MADAVENP

Good Morning list,

 

I would like to know if anyone else has experienced this issue or whether I am doing something wrong which is resulting in the following:

I am trying to calculate three earlier dates based on the difference between some given future dates and a value indicating number of days.  However, within each column of dates I get the same values, and this happens for all of the four dates regardless of the number of days (numdays) I subtract from the given dates (date1, date2,...) which are all different(?)  My code is below, and if anyone can point out if there is anything incorrect with it, I would appreciate it very much.

This is what the resulting data look like:

dt1

dt2

dt3

dt4

12/29/2004

12/28/2004

12/27/2004

12/26/2004

12/29/2004

12/28/2004

12/27/2004

12/26/2004

12/29/2004

12/28/2004

12/27/2004

12/26/2004

12/29/2004

12/28/2004

12/27/2004

12/26/2004

Here is the code: date1 through date4 vary and so does numdays(?)!

compute dt1=(date1-(numdays * 86400)).

compute dt2=(date2-(numdays * 86400)).

compute dt3=(date3-(numdays * 86400)).

compute dt4=(date4-(numdays * 86400)).

formats dt1 dt2 dt3 dt4 (adate10).

 

Any help, advice or suggestions would be very much appreciated.

TIA

Mike

Reply | Threaded
Open this post in threaded view
|

Re: Ver. 17.0.1 Date calculation error

Richard Ristow
At 12:25 PM 10/30/2009, Roberts, Michael wrote:

>I am trying to calculate three earlier dates based on the difference
>between some given future dates and a value indicating number of
>days.  However, within each column of dates I get the same values,
>and this happens for all of the four dates. My code is below.

Could you post the input data that gives the results you get? We
can't do much without it. I don't see anything obviously wrong with
your code, on simple inspection.

=====================
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: Ver. 17.0.1 Date calculation error

Roberts, Michael
Below is the input data:

numdays date1   date2   date3   dt1     dt2     dt3     dt4
34339   1/1/2099        1/2/2099        1/3/2099        12/29/2004      12/28/2004      12/27/2004      12/26/2004
34355   1/17/2099       1/18/2099       1/19/2099       12/29/2004      12/28/2004      12/27/2004      12/26/2004
34356   1/18/2099       1/19/2099       1/20/2099       12/29/2004      12/28/2004      12/27/2004      12/26/2004
34358   1/20/2099       1/21/2099       1/22/2099       12/29/2004      12/28/2004      12/27/2004      12/26/2004

-----Original Message-----
From: Richard Ristow [mailto:[hidden email]]
Sent: Friday, October 30, 2009 1:09 PM
To: Roberts, Michael; [hidden email]
Subject: Re: Ver. 17.0.1 Date calculation error

At 12:25 PM 10/30/2009, Roberts, Michael wrote:

>I am trying to calculate three earlier dates based on the difference
>between some given future dates and a value indicating number of
>days.  However, within each column of dates I get the same values,
>and this happens for all of the four dates. My code is below.

Could you post the input data that gives the results you get? We
can't do much without it. I don't see anything obviously wrong with
your code, on simple inspection.

=====================
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: Ver. 17.0.1 Date calculation error

Richard Ristow
At 02:09 PM 10/30/2009, Roberts, Michael wrote:

Below is the input data:
  numdays date1     date2     date3
  34339   1/1/2099  1/2/2099  1/3/2099
  34355   1/17/2099 1/18/2099 1/19/2099
  34356   1/18/2099 1/19/2099 1/20/2099
  34358   1/20/2099 1/21/2099 1/22/2099

You didn't give a DATE4, but that's OK; I'll do it for 1-3 only. You had complained that
within each column of dates I get the same values, and this happens for all of the four dates regardless of the number of days I subtract
as in this example you posted:

dt1        dt2        dt3        dt4
12/29/2004 12/28/2004 12/27/2004 12/26/2004
12/29/2004 12/28/2004 12/27/2004 12/26/2004
12/29/2004 12/28/2004 12/27/2004 12/26/2004
12/29/2004 12/28/2004 12/27/2004 12/26/2004

Using the test data you just sent, I get

compute dt1=(date1-(numdays * 86400)).
compute dt2=(date2-(numdays * 86400)).
compute dt3=(date3-(numdays * 86400)).

formats dt1 dt2 dt3 (adate10).
LIST.
List
|-----------------------------|---------------------------|
|Output Created               |30-OCT-2009 15:45:04       |
|-----------------------------|---------------------------|
numdays      date1      date2      date3        dt1        dt2        dt3

 34339  01/01/2099 01/02/2099 01/03/2099 12/26/2004 12/27/2004 12/28/2004
 34355  01/17/2099 01/18/2099 01/19/2099 12/26/2004 12/27/2004 12/28/2004
 34356  01/18/2099 01/19/2099 01/20/2099 12/26/2004 12/27/2004 12/28/2004
 34358  01/20/2099 01/21/2099 01/22/2099 12/26/2004 12/27/2004 12/28/2004

Number of cases read:  4    Number of cases listed:  4

So within each column, all the calculated dates are the same. It looks like that's the correct answer: that the 'numdays' values differ between rows exactly as much as the input dates differ.

You'll have to think about what that means, given what the data is about.

-Best of luck,
 Richard
=============================
APPENDIX: Test data, and code
=============================
DATA LIST LIST/
  numdays date1     date2     date3    
 (F5,     3ADATE10).
BEGIN DATA
  34339   1/1/2099  1/2/2099  1/3/2099 
  34355   1/17/2099 1/18/2099 1/19/2099
  34356   1/18/2099 1/19/2099 1/20/2099
  34358   1/20/2099 1/21/2099 1/22/2099
END DATA.


compute dt1=(date1-(numdays * 86400)).
compute dt2=(date2-(numdays * 86400)).
compute dt3=(date3-(numdays * 86400)).

formats dt1 dt2 dt3 (adate10).
LIST.

===================== 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: Ver. 17.0.1 Date calculation error

Roberts, Michael

Richard,

 

Thank you for checking the code, and for your response.  After posting and further examination, I noticed the incremental changes in the dates and number of days was the cause of the date being the same!  Looks like I have to do some additional digging into my data J

 

Mike

 

 

 

From: Richard Ristow [mailto:[hidden email]]
Sent: Friday, October 30, 2009 4:16 PM
To: Roberts, Michael; [hidden email]
Subject: Re: Ver. 17.0.1 Date calculation error

 

At 02:09 PM 10/30/2009, Roberts, Michael wrote:


Below is the input data:

  numdays date1     date2     date3
  34339   1/1/2099  1/2/2099  1/3/2099
  34355   1/17/2099 1/18/2099 1/19/2099
  34356   1/18/2099 1/19/2099 1/20/2099
  34358   1/20/2099 1/21/2099 1/22/2099

You didn't give a DATE4, but that's OK; I'll do it for 1-3 only. You had complained that

within each column of dates I get the same values, and this happens for all of the four dates regardless of the number of days I subtract

as in this example you posted:

dt1        dt2        dt3        dt4
12/29/2004 12/28/2004 12/27/2004 12/26/2004
12/29/2004 12/28/2004 12/27/2004 12/26/2004
12/29/2004 12/28/2004 12/27/2004 12/26/2004
12/29/2004 12/28/2004 12/27/2004 12/26/2004

Using the test data you just sent, I get

compute dt1=(date1-(numdays * 86400)).
compute dt2=(date2-(numdays * 86400)).
compute dt3=(date3-(numdays * 86400)).

formats dt1 dt2 dt3 (adate10).
LIST.
List
|-----------------------------|---------------------------|
|Output Created               |30-OCT-2009 15:45:04       |
|-----------------------------|---------------------------|
numdays      date1      date2      date3        dt1        dt2        dt3

 34339  01/01/2099 01/02/2099 01/03/2099 12/26/2004 12/27/2004 12/28/2004
 34355  01/17/2099 01/18/2099 01/19/2099 12/26/2004 12/27/2004 12/28/2004
 34356  01/18/2099 01/19/2099 01/20/2099 12/26/2004 12/27/2004 12/28/2004
 34358  01/20/2099 01/21/2099 01/22/2099 12/26/2004 12/27/2004 12/28/2004

Number of cases read:  4    Number of cases listed:  4

So within each column, all the calculated dates are the same. It looks like that's the correct answer: that the 'numdays' values differ between rows exactly as much as the input dates differ.

You'll have to think about what that means, given what the data is about.

-Best of luck,
 Richard
=============================
APPENDIX: Test data, and code
=============================
DATA LIST LIST/
  numdays date1     date2     date3    
 (F5,     3ADATE10).
BEGIN DATA
  34339   1/1/2099  1/2/2099  1/3/2099 
  34355   1/17/2099 1/18/2099 1/19/2099
  34356   1/18/2099 1/19/2099 1/20/2099
  34358   1/20/2099 1/21/2099 1/22/2099
END DATA.


compute dt1=(date1-(numdays * 86400)).
compute dt2=(date2-(numdays * 86400)).
compute dt3=(date3-(numdays * 86400)).

formats dt1 dt2 dt3 (adate10).
LIST.

 

Reply | Threaded
Open this post in threaded view
|

Re: Problems with the 'SORT' menu

SPSS Technical Support Notification
In reply to this post by ViAnn Beadle
Hi Mark,
 
I spent some time today trying to replicate this on Release 18 and was not able to do so, but I've opened a support case and will contact you directly. If anyone is able to provide a consistent replication scenario, we would be most appreciative.
 
Best regards,
 
Dave
 

David Nichols, Ph.D.
Master Statistician
SPSS, an IBM Company

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of ViAnn Beadle
Sent: Friday, October 30, 2009 11:05 AM
To: [hidden email]
Subject: Re: [SPSSX-L] Problems with the 'SORT' menu

Forwarding to the list. Sounds to me like there is a bug in the UI which persists settings from the last invocation of the dialog. At least users can get around this problem via syntax.

 

From: Mark A Davenport MADAVENP [mailto:[hidden email]]
Sent: Friday, October 30, 2009 9:34 AM
To: ViAnn Beadle
Subject: Re: Problems with the 'SORT' menu

 


If I write out a sort statement and run it in syntax, the sort runs fine.

***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962)




ViAnn Beadle <[hidden email]>
Sent by: "SPSSX(r) Discussion" <[hidden email]>

10/30/2009 11:28 AM

Please respond to
ViAnn Beadle <[hidden email]>

To

[hidden email]

cc

Subject

Re: Problems with the 'SORT' menu

 




What happens if you run the SORT using syntax?
 
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark A Davenport MADAVENP
Sent:
Friday, October 30, 2009 8:28 AM
To:
[hidden email]
Subject:
Problems with the 'SORT' menu

 

All,


Has anybody here noticed a problem with the 'sort cases' menu?  If I have been using PASW for some time, having opened, closed many files and run several procedures, the software seems to get 'tired' of sorting.  I might pull up the sort cases menu and try a simple sort.  I can pull the variable over and all of the buttons (OK, Paste, Reset, Cancel, Help) appear--none of them greyed out.  I click on 'OK' and nothing happens.  The image of the button appears to get 'pushed in' like it should but it just stays there.  The menu box doesn't close and the sort does not occur.  In the same instances, the Paste button doesn't seem to work either.  However, the Reset, Cancel, and Help buttons do work.  If I write out a sort statement and run it in syntax, the sort runs fine.  Once this occurs, the sort menu is useless for any other dataset window until I close eveything and reopen PASW.  This strange behavior doesn't seem  to occur with any other PASW menu window, just Sort Cases.  It occurs with 17.0.2 networked on a  big Dell desktop and on an individual license of 18 on my Lenovo laptop.


Has anybody else seen this?  I don't recall seeing this in the betas of either version.


***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than an exact answer to an approximate question.' --a paraphrase of J. W. Tukey (1962)