Dates: Subtracting number of months from a date

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

Dates: Subtracting number of months from a date

jimjohn
i have a variable called RepDate, which is in Date format. I have another variable called Age, which is a number to represetn the number of months since Issue Date. I want to calculate the Issue Date by subtracting from RepDate the number of months. Does anyone know hwo to do this in SPSS? I see a lot on subtracting one date from another but nto much on how to subtract a number of months from a date. Thanks so much in advance!
Reply | Threaded
Open this post in threaded view
|

Re: Dates: Subtracting number of months from a date

smarden1@gmail.com
You can use the DateSum command to add a specified number of units to a date.

The syntax looks like this...

DATESUM(datevar, value, "unit", "method").

For this case, your syntax would look like this...

COMPUTE newdate = DATESUM(repdate, -age, "months", 'closest').

Notice that the age is negative, this is because you are subtracting the age from the repdate and I am assuming that your age variable represents a positive number.

-Steve

2010/1/14 jimjohn <[hidden email]>
i have a variable called RepDate, which is in Date format. I have another
variable called Age, which is a number to represetn the number of months
since Issue Date. I want to calculate the Issue Date by subtracting from
RepDate the number of months. Does anyone know hwo to do this in SPSS? I see
a lot on subtracting one date from another but nto much on how to subtract a
number of months from a date. Thanks so much in advance!
--
View this message in context: http://old.nabble.com/Dates%3A-Subtracting-number-of-months-from-a-date-tp27169326p27169326.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: Dates: Subtracting number of months from a date

John F Hall
In reply to this post by jimjohn
----- Original Message -----
Sent: Friday, January 15, 2010 4:38 PM
Subject: RE: Dates: Subtracting number of months from a date

Dear John,

Please see below – it should work.

Jacqueline

 

 

COMMENT as SPSS does all its date calculations in seconds, you need to convert Age into seconds (as in brackets below below) then subtract from RepDate and then just format the new IssueDate variable as date and time .

 

COMPUTE IssueDate=RepDate - (Age*30.417*24*60*60).

FORMATS IssueDate(EDATE10) .

EXECUTE.

 

 

That should do it – I have checked it with some data of my own. 

 

 

Professor Jacqueline Collier
Tel:   0115 8230817         Mobile:   0771 781 401 8

Secretary   Shali Shah (Mon–Fri 10am-3pm)
[hidden email]
Tel:  0115 8230803       Fax: 0115 823 1208

 

From: John F Hall [mailto:[hidden email]]
Sent: 15 January 2010 15:12
To: Jacqueline Collier
Subject: Fw: Dates: Subtracting number of months from a date

 

 

----- Original Message -----

Sent: Thursday, January 14, 2010 11:39 PM

Subject: Dates: Subtracting number of months from a date

 


i have a variable called RepDate, which is in Date format. I have another
variable called Age, which is a number to represetn the number of months
since Issue Date. I want to calculate the Issue Date by subtracting from
RepDate the number of months. Does anyone know hwo to do this in SPSS? I see
a lot on subtracting one date from another but nto much on how to subtract a
number of months from a date. Thanks so much in advance!
--
View this message in context: http://old.nabble.com/Dates%3A-Subtracting-number-of-months-from-a-date-tp27169326p27169326.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

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


This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

----- Original Message -----
Sent: Thursday, January 14, 2010 11:39 PM
Subject: Dates: Subtracting number of months from a date


i have a variable called RepDate, which is in Date format. I have another
variable called Age, which is a number to represetn the number of months
since Issue Date. I want to calculate the Issue Date by subtracting from
RepDate the number of months. Does anyone know hwo to do this in SPSS? I see
a lot on subtracting one date from another but nto much on how to subtract a
number of months from a date. Thanks so much in advance!
--
View this message in context: http://old.nabble.com/Dates%3A-Subtracting-number-of-months-from-a-date-tp27169326p27169326.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: Dates: Subtracting number of months from a date

Jon K Peck

If you want calendar-correct results, you should use the DATESUM/DATEDIFF functions.
If you want to use the more arithmetic approach, the date functions in the xdate and date groups and  yrmoda will give more readable syntax and eliminate some sources of errors.

The Date and Time wizard on the Transform menu can walk you through these calculations.

HTH,
 
Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435



From: John F Hall <[hidden email]>
To: [hidden email]
Date: 01/15/2010 10:52 AM
Subject: Re: [SPSSX-L] Dates: Subtracting number of months from a date
Sent by: "SPSSX(r) Discussion" <[hidden email]>





----- Original Message -----
From: Jacqueline Collier
To: John F Hall
Sent: Friday, January 15, 2010 4:38 PM
Subject: RE: Dates: Subtracting number of months from a date

Dear John,

Please see below – it should work.

Jacqueline

 

 

COMMENT as SPSS does all its date calculations in seconds, you need to convert Age into seconds (as in brackets below below) then subtract from RepDate and then just format the new IssueDate variable as date and time .

 

COMPUTE IssueDate=RepDate - (Age*30.417*24*60*60).

FORMATS IssueDate(EDATE10) .

EXECUTE.

 

 

That should do it – I have checked it with some data of my own.  

 

 

Professor Jacqueline Collier
Tel:   0115 8230817         Mobile:   0771 781 401 8


Secretary   Shali Shah (Mon–Fri 10am-3pm)

v.shah@...
Tel:  0115 8230803       Fax: 0115 823 1208

 

From: John F Hall [mailto:johnfhall@...]
Sent:
15 January 2010 15:12
To:
Jacqueline Collier
Subject:
Fw: Dates: Subtracting number of months from a date

 

 

----- Original Message -----

From: jimjohn

To: [hidden email]

Sent: Thursday, January 14, 2010 11:39 PM

Subject: Dates: Subtracting number of months from a date

 


i have a variable called RepDate, which is in Date format. I have another
variable called Age, which is a number to represetn the number of months
since Issue Date. I want to calculate the Issue Date by subtracting from
RepDate the number of months. Does anyone know hwo to do this in SPSS? I see
a lot on subtracting one date from another but nto much on how to subtract a
number of months from a date. Thanks so much in advance!
--
View this message in context:
http://old.nabble.com/Dates%3A-Subtracting-number-of-months-from-a-date-tp27169326p27169326.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to

LISTSERV@... (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

This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

----- Original Message -----
From: jimjohn
To: [hidden email]
Sent: Thursday, January 14, 2010 11:39 PM
Subject: Dates: Subtracting number of months from a date


i have a variable called RepDate, which is in Date format. I have another
variable called Age, which is a number to represetn the number of months
since Issue Date. I want to calculate the Issue Date by subtracting from
RepDate the number of months. Does anyone know hwo to do this in SPSS? I see
a lot on subtracting one date from another but nto much on how to subtract a
number of months from a date. Thanks so much in advance!
--
View this message in context:
http://old.nabble.com/Dates%3A-Subtracting-number-of-months-from-a-date-tp27169326p27169326.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to

LISTSERV@... (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
|

different results for mixed and GLM

Joost van Ginkel
In reply to this post by smarden1@gmail.com
Hello,
 
I want to run an analysis with a continuous dependent variable, a continuous independent variable, a dichotomous independent variable, and the interaction between both independent variables. I've run the analysis using both GLM (univariate) and mixed models, and the results turn out to be different. Aren't the results supposed to be identical or do Mixed and GLM estimate different models?
 
Joost van Ginkel
 

Joost R. Van Ginkel, PhD
Leiden University
Faculty of Social and Behavioural Sciences
Data Theory Group
PO Box 9555
2300 RB Leiden
The Netherlands
Tel: +31-(0)71-527 3620
Fax: +31-(0)71-527 1721

**********************************************************************

This email and any files transmitted with it are confidential and

intended solely for the use of the individual or entity to whom they

are addressed. If you have received this email in error please notify

the system manager.

**********************************************************************

 

Reply | Threaded
Open this post in threaded view
|

Re: different results for mixed and GLM

Art Kendall
Please post a description of your data set.
 Do you have nested levels of cases?

Can you cobble together a small dataset  with DATA LIST  a few cases that has a structure similar to your data as well as the syntax for the two procedures that is giving results that are causing you a problem?

Art Kendall
Social Research Consultants

On 1/16/2010 7:08 AM, Ginkel, Joost van wrote:
Hello,
 
I want to run an analysis with a continuous dependent variable, a continuous independent variable, a dichotomous independent variable, and the interaction between both independent variables. I've run the analysis using both GLM (univariate) and mixed models, and the results turn out to be different. Aren't the results supposed to be identical or do Mixed and GLM estimate different models?
 
Joost van Ginkel
 

Joost R. Van Ginkel, PhD
Leiden University
Faculty of Social and Behavioural Sciences
Data Theory Group
PO Box 9555
2300 RB Leiden
The Netherlands
Tel: +31-(0)71-527 3620
Fax: +31-(0)71-527 1721

**********************************************************************

This email and any files transmitted with it are confidential and

intended solely for the use of the individual or entity to whom they

are addressed. If you have received this email in error please notify

the system manager.

**********************************************************************

 

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

Re: different results for mixed and GLM

Joost van Ginkel
Dear Art,
 
I just found out that the results do not differ. I got confused because I mixed up the results of the F-tests with the results of the t-tests of the parameters estimates. Results of the F-tests do not differ for mixed and GLM, and neither do the results of the t-tests. However, the results of the F-tests do differ from the results of the t-tests for the continuous variable. So this raises a new question: in an analysis with a dichotomous independent variable and a continuous independent variable, aren't the F-values simply the squared values of the t-tests? In this case I would expect the results of the F-test and the t-tests to be identical. However, this is not the case. How come? And if the results are indeed supposed to be different, then what does the one test tell us and what does the other one tell us?
 
Best regards,
 
Joost van Ginkel
 

Joost R. Van Ginkel, PhD
Leiden University
Faculty of Social and Behavioural Sciences
Data Theory Group
PO Box 9555
2300 RB Leiden
The Netherlands
Tel: +31-(0)71-527 3620
Fax: +31-(0)71-527 1721

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxx
Sent: 16 January 2010 21:14
To: [hidden email]
Subject: Re: different results for mixed and GLM

Please post a description of your data set.
 Do you have nested levels of cases?

Can you cobble together a small dataset  with DATA LIST  a few cases that has a structure similar to your data as well as the syntax for the two procedures that is giving results that are causing you a problem?

Art Kendall
Social Research Consultants

On 1/16/2010 7:08 AM, Ginkel, Joost van wrote:
Hello,
 
I want to run an analysis with a continuous dependent variable, a continuous independent variable, a dichotomous independent variable, and the interaction between both independent variables. I've run the analysis using both GLM (univariate) and mixed models, and the results turn out to be different. Aren't the results supposed to be identical or do Mixed and GLM estimate different models?
 
Joost van Ginkel
 

Joost R. Van Ginkel, PhD
Leiden University
Faculty of Social and Behavioural Sciences
Data Theory Group
PO Box 9555
2300 RB Leiden
The Netherlands
Tel: +31-(0)71-527 3620
Fax: +31-(0)71-527 1721

**********************************************************************

This email and any files transmitted with it are confidential and

intended solely for the use of the individual or entity to whom they

are addressed. If you have received this email in error please notify

the system manager.

**********************************************************************

 

===================== 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: different results for mixed and GLM

Garry Gelade
In reply to this post by Joost van Ginkel

If you have missing data, that could account for it. GLM omits whole cases if any variable is missing, but Mixed does not.

 

Garry

Business Analytic Ltd

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Ginkel, Joost van
Sent: 16 January 2010 12:09
To: [hidden email]
Subject: different results for mixed and GLM

 

Hello,

 

I want to run an analysis with a continuous dependent variable, a continuous independent variable, a dichotomous independent variable, and the interaction between both independent variables. I've run the analysis using both GLM (univariate) and mixed models, and the results turn out to be different. Aren't the results supposed to be identical or do Mixed and GLM estimate different models?

 

Joost van Ginkel

 

Joost R. Van Ginkel, PhD
Leiden University
Faculty of Social and Behavioural Sciences
Data Theory Group
PO Box 9555
2300 RB Leiden
The Netherlands
Tel: +31-(0)71-527 3620
Fax: +31-(0)71-527 1721

**********************************************************************

This email and any files transmitted with it are confidential and

intended solely for the use of the individual or entity to whom they

are addressed. If you have received this email in error please notify

the system manager.

**********************************************************************

 



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4782 (20100118) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
Reply | Threaded
Open this post in threaded view
|

Re: different results for mixed and GLM

luciano basso
In reply to this post by Joost van Ginkel
Dear Joost van Ginkel,

I am new to the world of statistics, but as far as I know between GLM
and Mixed .... the idea is the same, but the way and considerations
are different.

Can help you:

UGRINOWITSCH, CARLOS; FELLINGHAM, GILBERT W.; RICARD, MARK D.
Limitations of Ordinary Least Squares Models in Analyzing Repeated
Measures Data.
Medicine & Science in Sports & Exercise:
December 2004 - Volume 36 - Issue 12 - pp 2144-2148

Good Luck,

Luciano Basso
University of São Paulo
Laboratory of Motor Behavior
São Paulo - Brazil

=====================
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: different results for mixed and GLM

Maguin, Eugene
In reply to this post by Joost van Ginkel
Joost,

Please post your command syntax and the significance test results. I'm
assuming the difference you seeing is not 'decimal dust', i.e., 1.998**2 vs
4.00, so I think it will be helpful to all to see details.

Gene Maguin




Dear Art,

I just found out that the results do not differ. I got confused because I
mixed up the results of the F-tests with the results of the t-tests of the
parameters estimates. Results of the F-tests do not differ for mixed and
GLM, and neither do the results of the t-tests. However, the results of the
F-tests do differ from the results of the t-tests for the continuous
variable. So this raises a new question: in an analysis with a dichotomous
independent variable and a continuous independent variable, aren't the
F-values simply the squared values of the t-tests? In this case I would
expect the results of the F-test and the t-tests to be identical. However,
this is not the case. How come? And if the results are indeed supposed to be
different, then what does the one test tell us and what does the other one
tell us?

Best regards,

Joost van Ginkel


Joost R. Van Ginkel, PhD
Leiden University
Faculty of Social and Behavioural Sciences
Data Theory Group
PO Box 9555
2300 RB Leiden
The Netherlands
Tel: +31-(0)71-527 3620
Fax: +31-(0)71-527 1721



________________________________

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art
Kendall xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxx
Sent: 16 January 2010 21:14
To: [hidden email]
Subject: Re: different results for mixed and GLM


Please post a description of your data set.
 Do you have nested levels of cases?

Can you cobble together a small dataset  with DATA LIST  a few cases that
has a structure similar to your data as well as the syntax for the two
procedures that is giving results that are causing you a problem?

Art Kendall
Social Research Consultants

On 1/16/2010 7:08 AM, Ginkel, Joost van wrote:

        Hello,

        I want to run an analysis with a continuous dependent variable, a
continuous independent variable, a dichotomous independent variable, and the
interaction between both independent variables. I've run the analysis using
both GLM (univariate) and mixed models, and the results turn out to be
different. Aren't the results supposed to be identical or do Mixed and GLM
estimate different models?

        Joost van Ginkel


        Joost R. Van Ginkel, PhD
        Leiden University
        Faculty of Social and Behavioural Sciences
        Data Theory Group
        PO Box 9555
        2300 RB Leiden
        The Netherlands
        Tel: +31-(0)71-527 3620
        Fax: +31-(0)71-527 1721


**********************************************************************

        This email and any files transmitted with it are confidential and

        intended solely for the use of the individual or entity to whom they

        are addressed. If you have received this email in error please
notify

        the system manager.


**********************************************************************



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

missing values in MIXED and GLM [was Re: different results for mixed and GLM]

Alex Reutter
In reply to this post by Garry Gelade

To expand a bit on the below:

MIXED, like GLM, omits whole rows if any variable in the analysis has invalid values**; however, repeated measurements in MIXED are spread out over multiple rows, so MIXED will use the rows with valid values for a given subject.  By contrast, repeated measurements in GLM are spread out over multiple variables and each subject occupies a single row, so if any variable for a given subject is invalid, all observations for that subject are thrown out.

Alex

** MIXED does have the additional option of treating user-missing values of categorical variables as valid, so it is possible in a simple GLM Univariate model that user-missing values could cause different results between the two procedures.



From: Garry Gelade <[hidden email]>
To: [hidden email]
Date: 01/18/2010 06:16 AM
Subject: Re: different results for mixed and GLM
Sent by: "SPSSX(r) Discussion" <[hidden email]>





If you have missing data, that could account for it. GLM omits whole cases if any variable is missing, but Mixed does not.
 
Garry
Business Analytic Ltd
 
From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Ginkel, Joost van
Sent:
16 January 2010 12:09
To:
[hidden email]
Subject:
different results for mixed and GLM

 
Hello,
 
I want to run an analysis with a continuous dependent variable, a continuous independent variable, a dichotomous independent variable, and the interaction between both independent variables. I've run the analysis using both GLM (univariate) and mixed models, and the results turn out to be different. Aren't the results supposed to be identical or do Mixed and GLM estimate different models?
 
Joost van Ginkel
 

Joost R. Van Ginkel, PhD
Leiden University

Faculty of Social and Behavioural Sciences

Data Theory Group

PO Box 9555

2300 RB Leiden

The Netherlands

Tel: +31-(0)71-527 3620

Fax: +31-(0)71-527 1721

Reply | Threaded
Open this post in threaded view
|

Re: different results for mixed and GLM

Joost van Ginkel
In reply to this post by Maguin, Eugene
Dear Gene,

Please, try this:

Data list free/v1 v2 v3 .
begin data
1 9.70068493150685 31
0 9.17214611872146 24
1 9.22808219178082 26
0 9.69246575342466 35
0 9.73082191780822 32
0 10.736301369863 23
1 9.72808219178082 27
0 9.53401826484018 33
1 9.06689497716895 28
0 9.53675799086758 32
1 9.71986301369863 31
0 9.69246575342466 33
0 9.29223744292237 31
0 10.9057077625571 33
end data.
FORMAT V1 (F1.0) .


MIXED v3 BY v1 WITH v2
  /CRITERIA=CIN(95) MXITER(100) MXSTEP(5) SCORING(1)
SINGULAR(0.000000000001) HCONVERGE(0,
    ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE)
  /FIXED=v1 v2 v1*v2 | SSTYPE(3)
  /METHOD=REML
  /PRINT=SOLUTION.

UNIANOVA v3 BY v1 WITH v2
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /PRINT=PARAMETER
  /CRITERIA=ALPHA(.05)
  /DESIGN=v2 v1 v1*v2.

You'll see that the results for Mixed and GLM are the same but that the
results of the t-tests and F-tests differ for the intercept and the
continuous variable V2. So what I don't understand is: how comes it that
the t- and F-tests give different p-values here?

Best regards,

Joost van Ginkel

Joost R. Van Ginkel, PhD
Leiden University
Faculty of Social and Behavioural Sciences
Data Theory Group
PO Box 9555
2300 RB Leiden
The Netherlands
Tel: +31-(0)71-527 3620
Fax: +31-(0)71-527 1721


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Gene Maguin
Sent: 18 January 2010 16:34
To: [hidden email]
Subject: Re: different results for mixed and GLM

Joost,

Please post your command syntax and the significance test results. I'm
assuming the difference you seeing is not 'decimal dust', i.e., 1.998**2
vs 4.00, so I think it will be helpful to all to see details.

Gene Maguin




Dear Art,

I just found out that the results do not differ. I got confused because
I mixed up the results of the F-tests with the results of the t-tests of
the parameters estimates. Results of the F-tests do not differ for mixed
and GLM, and neither do the results of the t-tests. However, the results
of the F-tests do differ from the results of the t-tests for the
continuous variable. So this raises a new question: in an analysis with
a dichotomous independent variable and a continuous independent
variable, aren't the F-values simply the squared values of the t-tests?
In this case I would expect the results of the F-test and the t-tests to
be identical. However, this is not the case. How come? And if the
results are indeed supposed to be different, then what does the one test
tell us and what does the other one tell us?

Best regards,

Joost van Ginkel


Joost R. Van Ginkel, PhD
Leiden University
Faculty of Social and Behavioural Sciences Data Theory Group PO Box 9555
2300 RB Leiden The Netherlands
Tel: +31-(0)71-527 3620
Fax: +31-(0)71-527 1721



________________________________

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Art Kendall xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxx
Sent: 16 January 2010 21:14
To: [hidden email]
Subject: Re: different results for mixed and GLM


Please post a description of your data set.
 Do you have nested levels of cases?

Can you cobble together a small dataset  with DATA LIST  a few cases
that has a structure similar to your data as well as the syntax for the
two procedures that is giving results that are causing you a problem?

Art Kendall
Social Research Consultants

On 1/16/2010 7:08 AM, Ginkel, Joost van wrote:

        Hello,

        I want to run an analysis with a continuous dependent variable,
a continuous independent variable, a dichotomous independent variable,
and the interaction between both independent variables. I've run the
analysis using both GLM (univariate) and mixed models, and the results
turn out to be different. Aren't the results supposed to be identical or
do Mixed and GLM estimate different models?

        Joost van Ginkel


        Joost R. Van Ginkel, PhD
        Leiden University
        Faculty of Social and Behavioural Sciences
        Data Theory Group
        PO Box 9555
        2300 RB Leiden
        The Netherlands
        Tel: +31-(0)71-527 3620
        Fax: +31-(0)71-527 1721


**********************************************************************

        This email and any files transmitted with it are confidential
and

        intended solely for the use of the individual or entity to whom
they

        are addressed. If you have received this email in error please
notify

        the system manager.


**********************************************************************



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

Re: different results for mixed and GLM

Maguin, Eugene
Joost,

I don't know the answer and I'd be interested to hear about this from
someone that does. Specifically, in your model, v3 by v1 with v2, the square
root of F equals the t value for the v1 and the v1*v2 effects but not for
the v2 and intercept effects. Specifically,

Effect    F-value  sqrt(F)  t-value
-----------------------------------
V1*v2      0.530   0.728     -0.728
V1         0.580   0.7615     0.762
V2         0.234   0.483      0.646
Int        0.213   0.462     -0.161


Gene Maguin

=====================
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: different results for mixed and GLM

Bruce Weaver
Administrator
In reply to this post by Joost van Ginkel
Ginkel, Joost van wrote
Dear Gene,

Please, try this:

Data list free/v1 v2 v3 .
begin data
1 9.70068493150685 31
0 9.17214611872146 24
1 9.22808219178082 26
0 9.69246575342466 35
0 9.73082191780822 32
0 10.736301369863 23
1 9.72808219178082 27
0 9.53401826484018 33
1 9.06689497716895 28
0 9.53675799086758 32
1 9.71986301369863 31
0 9.69246575342466 33
0 9.29223744292237 31
0 10.9057077625571 33
end data.
FORMAT V1 (F1.0) .


MIXED v3 BY v1 WITH v2
  /CRITERIA=CIN(95) MXITER(100) MXSTEP(5) SCORING(1)
SINGULAR(0.000000000001) HCONVERGE(0,
    ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE)
  /FIXED=v1 v2 v1*v2 | SSTYPE(3)
  /METHOD=REML
  /PRINT=SOLUTION.

UNIANOVA v3 BY v1 WITH v2
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /PRINT=PARAMETER
  /CRITERIA=ALPHA(.05)
  /DESIGN=v2 v1 v1*v2.

You'll see that the results for Mixed and GLM are the same but that the
results of the t-tests and F-tests differ for the intercept and the
continuous variable V2. So what I don't understand is: how comes it that
the t- and F-tests give different p-values here?

Best regards,

Joost van Ginkel
And to make it even more interesting, note that V1 is binary (coded 0-1), so treating it as continuous rather than categorical should not change the results (apart from the sign on a coefficient, perhaps).  But try this:

MIXED v3 WITH v1 v2
  /CRITERIA=CIN(95) MXITER(100) MXSTEP(5) SCORING(1)
SINGULAR(0.000000000001) HCONVERGE(0,
    ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE)
  /FIXED=v1 v2 v1*v2 | SSTYPE(3)
  /METHOD=REML
  /PRINT=SOLUTION.

I get the same deviance as for the model with "BY V1", but there are other differences that seem a bit odd.  I wonder if it has to do with centering of variables?

And of course, one could also run the model via REGRESSION, like this:

compute v1v2 = v1*v2.
REGRESSION
  /STATISTICS COEFF OUTS CI(95) R ANOVA
  /DEPENDENT v3
  /METHOD=TEST (v1) (v2) (v1v2) .


Cheers,
Bruce
--
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
|

Re: different results for mixed and GLM

Mike Speed-3
The reason is that different things are being tested:

For the F Table,
the intercept is testing that the sum of the two intercepts = 0,
and v2 is testing that the sum of the slopes = 0.

While in the t - table,
the intercept is testing that the second intercept = 0,
and v2 is testing that the second slope = 0.

Mike


F. Michael Speed
Professor
Director of Online Learning
Department of Statistics
Associate Dean for Technology Mediated Instruction
College of Science
TAMU
 979-845-3182



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Bruce Weaver
Sent: Tuesday, January 19, 2010 5:11 PM
To: [hidden email]
Subject: Re: different results for mixed and GLM

Ginkel, Joost van wrote:

>
> Dear Gene,
>
> Please, try this:
>
> Data list free/v1 v2 v3 .
> begin data
> 1 9.70068493150685 31
> 0 9.17214611872146 24
> 1 9.22808219178082 26
> 0 9.69246575342466 35
> 0 9.73082191780822 32
> 0 10.736301369863 23
> 1 9.72808219178082 27
> 0 9.53401826484018 33
> 1 9.06689497716895 28
> 0 9.53675799086758 32
> 1 9.71986301369863 31
> 0 9.69246575342466 33
> 0 9.29223744292237 31
> 0 10.9057077625571 33
> end data.
> FORMAT V1 (F1.0) .
>
>
> MIXED v3 BY v1 WITH v2
>   /CRITERIA=CIN(95) MXITER(100) MXSTEP(5) SCORING(1)
> SINGULAR(0.000000000001) HCONVERGE(0,
>     ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE)
>   /FIXED=v1 v2 v1*v2 | SSTYPE(3)
>   /METHOD=REML
>   /PRINT=SOLUTION.
>
> UNIANOVA v3 BY v1 WITH v2
>   /METHOD=SSTYPE(3)
>   /INTERCEPT=INCLUDE
>   /PRINT=PARAMETER
>   /CRITERIA=ALPHA(.05)
>   /DESIGN=v2 v1 v1*v2.
>
> You'll see that the results for Mixed and GLM are the same but that the
> results of the t-tests and F-tests differ for the intercept and the
> continuous variable V2. So what I don't understand is: how comes it that
> the t- and F-tests give different p-values here?
>
> Best regards,
>
> Joost van Ginkel
>
>

And to make it even more interesting, note that V1 is binary (coded 0-1), so
treating it as continuous rather than categorical should not change the
results (apart from the sign on a coefficient, perhaps).  But try this:

MIXED v3 WITH v1 v2
  /CRITERIA=CIN(95) MXITER(100) MXSTEP(5) SCORING(1)
SINGULAR(0.000000000001) HCONVERGE(0,
    ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE)
  /FIXED=v1 v2 v1*v2 | SSTYPE(3)
  /METHOD=REML
  /PRINT=SOLUTION.

I get the same deviance as for the model with "BY V1", but there are other
differences that seem a bit odd.  I wonder if it has to do with centering of
variables?

And of course, one could also run the model via REGRESSION, like this:

compute v1v2 = v1*v2.
REGRESSION
  /STATISTICS COEFF OUTS CI(95) R ANOVA
  /DEPENDENT v3
  /METHOD=TEST (v1) (v2) (v1v2) .


Cheers,
Bruce


-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/
"When all else fails, RTFM."

NOTE:  My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
--
View this message in context: http://old.nabble.com/Dates%3A-Subtracting-number-of-months-from-a-date-tp27169326p27234394.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

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

Re: different results for mixed and GLM

Joost van Ginkel
Dear Mike,

Thank you very much for your answer (and of course all the others who
responded to my message). This explains a lot!

Best regards,

Joost van Ginkel


Joost R. Van Ginkel, PhD
Leiden University
Faculty of Social and Behavioural Sciences
Data Theory Group
PO Box 9555
2300 RB Leiden
The Netherlands
Tel: +31-(0)71-527 3620
Fax: +31-(0)71-527 1721


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Mike Speed
Sent: 20 January 2010 00:38
To: [hidden email]
Subject: Re: different results for mixed and GLM

The reason is that different things are being tested:

For the F Table,
the intercept is testing that the sum of the two intercepts = 0, and v2
is testing that the sum of the slopes = 0.

While in the t - table,
the intercept is testing that the second intercept = 0, and v2 is
testing that the second slope = 0.

Mike


F. Michael Speed
Professor
Director of Online Learning
Department of Statistics
Associate Dean for Technology Mediated Instruction College of Science
TAMU
 979-845-3182



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Bruce Weaver
Sent: Tuesday, January 19, 2010 5:11 PM
To: [hidden email]
Subject: Re: different results for mixed and GLM

Ginkel, Joost van wrote:

>
> Dear Gene,
>
> Please, try this:
>
> Data list free/v1 v2 v3 .
> begin data
> 1 9.70068493150685 31
> 0 9.17214611872146 24
> 1 9.22808219178082 26
> 0 9.69246575342466 35
> 0 9.73082191780822 32
> 0 10.736301369863 23
> 1 9.72808219178082 27
> 0 9.53401826484018 33
> 1 9.06689497716895 28
> 0 9.53675799086758 32
> 1 9.71986301369863 31
> 0 9.69246575342466 33
> 0 9.29223744292237 31
> 0 10.9057077625571 33
> end data.
> FORMAT V1 (F1.0) .
>
>
> MIXED v3 BY v1 WITH v2
>   /CRITERIA=CIN(95) MXITER(100) MXSTEP(5) SCORING(1)
> SINGULAR(0.000000000001) HCONVERGE(0,
>     ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE)
>   /FIXED=v1 v2 v1*v2 | SSTYPE(3)
>   /METHOD=REML
>   /PRINT=SOLUTION.
>
> UNIANOVA v3 BY v1 WITH v2
>   /METHOD=SSTYPE(3)
>   /INTERCEPT=INCLUDE
>   /PRINT=PARAMETER
>   /CRITERIA=ALPHA(.05)
>   /DESIGN=v2 v1 v1*v2.
>
> You'll see that the results for Mixed and GLM are the same but that
> the results of the t-tests and F-tests differ for the intercept and
> the continuous variable V2. So what I don't understand is: how comes
> it that the t- and F-tests give different p-values here?
>
> Best regards,
>
> Joost van Ginkel
>
>

And to make it even more interesting, note that V1 is binary (coded
0-1), so treating it as continuous rather than categorical should not
change the results (apart from the sign on a coefficient, perhaps).  But
try this:

MIXED v3 WITH v1 v2
  /CRITERIA=CIN(95) MXITER(100) MXSTEP(5) SCORING(1)
SINGULAR(0.000000000001) HCONVERGE(0,
    ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE)
  /FIXED=v1 v2 v1*v2 | SSTYPE(3)
  /METHOD=REML
  /PRINT=SOLUTION.

I get the same deviance as for the model with "BY V1", but there are
other differences that seem a bit odd.  I wonder if it has to do with
centering of variables?

And of course, one could also run the model via REGRESSION, like this:

compute v1v2 = v1*v2.
REGRESSION
  /STATISTICS COEFF OUTS CI(95) R ANOVA
  /DEPENDENT v3
  /METHOD=TEST (v1) (v2) (v1v2) .


Cheers,
Bruce


-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/
"When all else fails, RTFM."

NOTE:  My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
--
View this message in context:
http://old.nabble.com/Dates%3A-Subtracting-number-of-months-from-a-date-
tp27169326p27234394.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

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

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************

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