Dear list, I was wondering whether it is possible to use effect coding instead of dummy coding in Mixed models for categorical variables. If so, how can you do this? Best regards, Joost van Ginkel ********************************************************************** 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. **********************************************************************
|
There is no way to request effect coding during estimation of the mixed model; you would need to recode the variable(s) prior to running MIXED and pass it the recoded variables. Note that if your aim in using something other than dummy coding is to obtain some specific test of contrasts between levels of a categorical variable, you're probably better off specifying the test you want on the TEST subcommand. Alex
Dear list, I was wondering whether it is possible to use effect coding instead of dummy coding in Mixed models for categorical variables. If so, how can you do this? Best regards, Joost van Ginkel
|
Dear Alex,
Thanks for your reply. I'll see if the TEST option
works.
Best regards,
Joost van Ginkel
Joost R. van Ginkel, PhD From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Alex Reutter Sent: Monday, November 15, 2010 5:42 PM To: [hidden email] Subject: Re: Effect coding in mixed models There is no way to request effect coding during estimation of the mixed model; you would need to recode the variable(s) prior to running MIXED and pass it the recoded variables. Note that if your aim in using something other than dummy coding is to obtain some specific test of contrasts between levels of a categorical variable, you're probably better off specifying the test you want on the TEST subcommand. Alex
Dear list, I was wondering whether it is possible to use effect coding instead of dummy coding in Mixed models for categorical variables. If so, how can you do this? Best regards, Joost van Ginkel ********************************************************************** 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. **********************************************************************
|
Joost,
I assume you want to compare each of the group means to the grand mean. Am I right? If yes, take a look at the example I provide below. This is the first time I've done this, so I'm not certain it is correct. I think this approach should work. I'll write back if I come up with evidence that suggests otherwise. Ryan -- data list list / ID Group Y. begin data 1 1 24 2 1 22 3 1 21 4 1 23 5 2 67 6 2 66 7 2 67 8 2 65 9 3 43 10 3 44 11 3 45 12 3 42 13 4 12 14 4 11 15 4 10 16 4 13 end data. MIXED Y BY Group /FIXED= Group | SSTYPE(3) /METHOD=REML /PRINT= SOLUTION DESCRIPTIVES /TEST ='Grand Versus Group 1' Intercept 0 Group -12 4 4 4 Divisor=16 /TEST ='Grand Versus Group 2' Intercept 0 Group 4 -12 4 4 Divisor=16 /TEST ='Grand Versus Group 3' Intercept 0 Group 4 4 -12 4 Divisor=16 /TEST ='Grand Versus Group 4' Intercept 0 Group 4 4 4 -12 Divisor=16. On Tue, Nov 16, 2010 at 8:28 AM, Ginkel, Joost van <[hidden email]> wrote: > > Dear Alex, > > Thanks for your reply. I'll see if the TEST option works. > > Best regards, > > Joost van Ginkel > > > Joost R. van Ginkel, PhD > Leiden University > Faculty of Social and Behavioural Sciences > PO Box 9555 > 2300 RB Leiden > The Netherlands > Tel: +31-(0)71-527 3620 > Fax: +31-(0)71-527 3945 > > > ________________________________ > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Alex Reutter > Sent: Monday, November 15, 2010 5:42 PM > To: [hidden email] > Subject: Re: Effect coding in mixed models > > > There is no way to request effect coding during estimation of the mixed model; you would need to recode the variable(s) prior to running MIXED and pass it the recoded variables. Note that if your aim in using something other than dummy coding is to obtain some specific test of contrasts between levels of a categorical variable, you're probably better off specifying the test you want on the TEST subcommand. > > Alex > > > From: "Ginkel, Joost van" <[hidden email]> > To: [hidden email] > Date: 11/15/2010 09:59 AM > Subject: Effect coding in mixed models > Sent by: "SPSSX(r) Discussion" <[hidden email]> > ________________________________ > > > Dear list, > > I was wondering whether it is possible to use effect coding instead of dummy coding in Mixed models for categorical variables. If so, how can you do this? > > Best regards, > > Joost van Ginkel > > 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 |
Dear Ryan,
Yes, this is what I meant. Too bad it doesn't give the covariance matrix of the parameters in the output (which I needed too), except for the dummy coded solution. Anyway, thank you very much for sending me this. Best regards, Joost van Ginkel Joost R. van Ginkel, PhD Leiden University Faculty of Social and Behavioural Sciences PO Box 9555 2300 RB Leiden The Netherlands Tel: +31-(0)71-527 3620 Fax: +31-(0)71-527 3945 -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of R B Sent: Wednesday, November 17, 2010 4:44 AM To: [hidden email] Subject: Re: Effect coding in mixed models Joost, I assume you want to compare each of the group means to the grand mean. Am I right? If yes, take a look at the example I provide below. This is the first time I've done this, so I'm not certain it is correct. I think this approach should work. I'll write back if I come up with evidence that suggests otherwise. Ryan -- data list list / ID Group Y. begin data 1 1 24 2 1 22 3 1 21 4 1 23 5 2 67 6 2 66 7 2 67 8 2 65 9 3 43 10 3 44 11 3 45 12 3 42 13 4 12 14 4 11 15 4 10 16 4 13 end data. MIXED Y BY Group /FIXED= Group | SSTYPE(3) /METHOD=REML /PRINT= SOLUTION DESCRIPTIVES /TEST ='Grand Versus Group 1' Intercept 0 Group -12 4 4 4 Divisor=16 /TEST ='Grand Versus Group 2' Intercept 0 Group 4 -12 4 4 Divisor=16 /TEST ='Grand Versus Group 3' Intercept 0 Group 4 4 -12 4 Divisor=16 /TEST ='Grand Versus Group 4' Intercept 0 Group 4 4 4 -12 Divisor=16. On Tue, Nov 16, 2010 at 8:28 AM, Ginkel, Joost van <[hidden email]> wrote: > > Dear Alex, > > Thanks for your reply. I'll see if the TEST option works. > > Best regards, > > Joost van Ginkel > > > Joost R. van Ginkel, PhD > Leiden University > Faculty of Social and Behavioural Sciences PO Box 9555 2300 RB Leiden > The Netherlands > Tel: +31-(0)71-527 3620 > Fax: +31-(0)71-527 3945 > > > ________________________________ > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf > Of Alex Reutter > Sent: Monday, November 15, 2010 5:42 PM > To: [hidden email] > Subject: Re: Effect coding in mixed models > > > There is no way to request effect coding during estimation of the MIXED and pass it the recoded variables. Note that if your aim in using something other than dummy coding is to obtain some specific test of contrasts between levels of a categorical variable, you're probably better off specifying the test you want on the TEST subcommand. > > Alex > > > From: "Ginkel, Joost van" <[hidden email]> > To: [hidden email] > Date: 11/15/2010 09:59 AM > Subject: Effect coding in mixed models Sent by: "SPSSX(r) Discussion" > <[hidden email]> ________________________________ > > > Dear list, > > I was wondering whether it is possible to use effect coding instead of you do this? > > Best regards, > > Joost van Ginkel > > 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 |
Dear Joost
If you truly desire the effect coding solution along with the covariance matrix, then I wonder about creating a set of variables yourself that use an effect coding system and then entering those effect coded variables into the mixed model. If you want to give that a try, you can see http://www.ats.ucla.edu/stat/spss/webbooks/reg/chapter5/spssreg5.htm which provides examples of different coding systems, including simple coding (which I believe would correspond to effect coding). While the web page there describes the use of the LMATRIX command for this coding, it also illustrates the coding systems. I hope that is helpful, Michael N. Mitchell Data Management Using Stata - http://www.stata.com/bookstore/dmus.html A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html Stata tidbit of the week - http://www.MichaelNormanMitchell.com On 2010-11-17 12.30 AM, Ginkel, Joost van wrote: > Dear Ryan, > > Yes, this is what I meant. Too bad it doesn't give the covariance matrix > of the parameters in the output (which I needed too), except for the > dummy coded solution. Anyway, thank you very much for sending me this. > > Best regards, > > Joost van Ginkel > > > > Joost R. van Ginkel, PhD > Leiden University > Faculty of Social and Behavioural Sciences > PO Box 9555 > 2300 RB Leiden > The Netherlands > Tel: +31-(0)71-527 3620 > Fax: +31-(0)71-527 3945 > > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of > R B > Sent: Wednesday, November 17, 2010 4:44 AM > To: [hidden email] > Subject: Re: Effect coding in mixed models > > Joost, > > I assume you want to compare each of the group means to the grand mean. > Am I right? If yes, take a look at the example I provide below. > This is the first time I've done this, so I'm not certain it is correct. > I think this approach should work. I'll write back if I come up with > evidence that suggests otherwise. > > Ryan > > -- > > data list list / ID Group Y. > begin data > 1 1 24 > 2 1 22 > 3 1 21 > 4 1 23 > 5 2 67 > 6 2 66 > 7 2 67 > 8 2 65 > 9 3 43 > 10 3 44 > 11 3 45 > 12 3 42 > 13 4 12 > 14 4 11 > 15 4 10 > 16 4 13 > end data. > > MIXED Y BY Group > /FIXED= Group | SSTYPE(3) > /METHOD=REML > /PRINT= SOLUTION DESCRIPTIVES > /TEST ='Grand Versus Group 1' Intercept 0 Group -12 4 4 4 Divisor=16 > /TEST ='Grand Versus Group 2' Intercept 0 Group 4 -12 4 4 Divisor=16 > /TEST ='Grand Versus Group 3' Intercept 0 Group 4 4 -12 4 Divisor=16 > /TEST ='Grand Versus Group 4' Intercept 0 Group 4 4 4 -12 Divisor=16. > > On Tue, Nov 16, 2010 at 8:28 AM, Ginkel, Joost van > <[hidden email]> wrote: >> >> Dear Alex, >> >> Thanks for your reply. I'll see if the TEST option works. >> >> Best regards, >> >> Joost van Ginkel >> >> >> Joost R. van Ginkel, PhD >> Leiden University >> Faculty of Social and Behavioural Sciences PO Box 9555 2300 RB Leiden >> The Netherlands >> Tel: +31-(0)71-527 3620 >> Fax: +31-(0)71-527 3945 >> >> >> ________________________________ >> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf >> Of Alex Reutter >> Sent: Monday, November 15, 2010 5:42 PM >> To: [hidden email] >> Subject: Re: Effect coding in mixed models >> >> >> There is no way to request effect coding during estimation of the > mixed model; you would need to recode the variable(s) prior to running > MIXED and pass it the recoded variables. Note that if your aim in using > something other than dummy coding is to obtain some specific test of > contrasts between levels of a categorical variable, you're probably > better off specifying the test you want on the TEST subcommand. >> >> Alex >> >> >> From: "Ginkel, Joost van"<[hidden email]> >> To: [hidden email] >> Date: 11/15/2010 09:59 AM >> Subject: Effect coding in mixed models Sent by: "SPSSX(r) Discussion" >> <[hidden email]> ________________________________ >> >> >> Dear list, >> >> I was wondering whether it is possible to use effect coding instead of > dummy coding in Mixed models for categorical variables. If so, how can > you do this? >> >> Best regards, >> >> Joost van Ginkel >> >> 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 |
Dear Michael,
Thank you very much, I will take a look into this! Best regards, Joost van Ginkel Joost R. van Ginkel, PhD Leiden University Faculty of Social and Behavioural Sciences PO Box 9555 2300 RB Leiden The Netherlands Tel: +31-(0)71-527 3620 Fax: +31-(0)71-527 3945 -----Original Message----- From: Michael Mitchell [mailto:[hidden email]] On Behalf Of Michael N. Mitchell Sent: Wednesday, November 17, 2010 9:56 AM To: Ginkel, Joost van Cc: [hidden email] Subject: Re: Effect coding in mixed models Dear Joost If you truly desire the effect coding solution along with the covariance matrix, then I wonder about creating a set of variables yourself that use an effect coding system and then entering those effect coded variables into the mixed model. If you want to give that a try, you can see http://www.ats.ucla.edu/stat/spss/webbooks/reg/chapter5/spssreg5.htm which provides examples of different coding systems, including simple coding (which I believe would correspond to effect coding). While the web page there describes the use of the LMATRIX command for this coding, it also illustrates the coding systems. I hope that is helpful, Michael N. Mitchell Data Management Using Stata - http://www.stata.com/bookstore/dmus.html A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html Stata tidbit of the week - http://www.MichaelNormanMitchell.com On 2010-11-17 12.30 AM, Ginkel, Joost van wrote: > Dear Ryan, > > Yes, this is what I meant. Too bad it doesn't give the covariance > matrix of the parameters in the output (which I needed too), except > for the dummy coded solution. Anyway, thank you very much for sending me this. > > Best regards, > > Joost van Ginkel > > > > Joost R. van Ginkel, PhD > Leiden University > Faculty of Social and Behavioural Sciences PO Box 9555 2300 RB Leiden > The Netherlands > Tel: +31-(0)71-527 3620 > Fax: +31-(0)71-527 3945 > > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf > Of R B > Sent: Wednesday, November 17, 2010 4:44 AM > To: [hidden email] > Subject: Re: Effect coding in mixed models > > Joost, > > I assume you want to compare each of the group means to the grand > Am I right? If yes, take a look at the example I provide below. > This is the first time I've done this, so I'm not certain it is correct. > I think this approach should work. I'll write back if I come up with > evidence that suggests otherwise. > > Ryan > > -- > > data list list / ID Group Y. > begin data > 1 1 24 > 2 1 22 > 3 1 21 > 4 1 23 > 5 2 67 > 6 2 66 > 7 2 67 > 8 2 65 > 9 3 43 > 10 3 44 > 11 3 45 > 12 3 42 > 13 4 12 > 14 4 11 > 15 4 10 > 16 4 13 > end data. > > MIXED Y BY Group > /FIXED= Group | SSTYPE(3) > /METHOD=REML > /PRINT= SOLUTION DESCRIPTIVES > /TEST ='Grand Versus Group 1' Intercept 0 Group -12 4 4 4 Divisor=16 > /TEST ='Grand Versus Group 2' Intercept 0 Group 4 -12 4 4 Divisor=16 > /TEST ='Grand Versus Group 3' Intercept 0 Group 4 4 -12 4 Divisor=16 > /TEST ='Grand Versus Group 4' Intercept 0 Group 4 4 4 -12 Divisor=16. > > On Tue, Nov 16, 2010 at 8:28 AM, Ginkel, Joost van > <[hidden email]> wrote: >> >> Dear Alex, >> >> Thanks for your reply. I'll see if the TEST option works. >> >> Best regards, >> >> Joost van Ginkel >> >> >> Joost R. van Ginkel, PhD >> Leiden University >> Faculty of Social and Behavioural Sciences PO Box 9555 2300 RB Leiden >> The Netherlands >> Tel: +31-(0)71-527 3620 >> Fax: +31-(0)71-527 3945 >> >> >> ________________________________ >> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf >> Of Alex Reutter >> Sent: Monday, November 15, 2010 5:42 PM >> To: [hidden email] >> Subject: Re: Effect coding in mixed models >> >> >> There is no way to request effect coding during estimation of the > mixed model; you would need to recode the variable(s) prior to running > MIXED and pass it the recoded variables. Note that if your aim in > using something other than dummy coding is to obtain some specific > test of contrasts between levels of a categorical variable, you're > probably better off specifying the test you want on the TEST subcommand. >> >> Alex >> >> >> From: "Ginkel, Joost van"<[hidden email]> >> To: [hidden email] >> Date: 11/15/2010 09:59 AM >> Subject: Effect coding in mixed models Sent by: "SPSSX(r) Discussion" >> <[hidden email]> ________________________________ >> >> >> Dear list, >> >> I was wondering whether it is possible to use effect coding instead >> of > dummy coding in Mixed models for categorical variables. If so, how can > you do this? >> >> Best regards, >> >> Joost van Ginkel >> >> 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 ********************************************************************** 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 |
In reply to this post by Ryan
Hello:
For those interested, one could perform the group versus grand mean contrasts employing the brand new GENLINMIXED procedure (in SPSS 19) via the EMMEANS statement, along with the COMPARE and CONTRAST keywords. To demonstrate how to do so, I fit the GENLINMIXED model on the data presented previously. Note that the estimates, standard errors, and p-values are virtually identical to those from the estimate statements performed in the MIXED code. data list list / ID Group Y. begin data 1 1 24 2 1 22 3 1 21 4 1 23 5 2 67 6 2 66 7 2 67 8 2 65 9 3 43 10 3 44 11 3 45 12 3 42 13 4 12 14 4 11 15 4 10 16 4 13 end data. GENLINMIXED /FIELDS TARGET=Y /TARGET_OPTIONS DISTRIBUTION=NORMAL LINK=IDENTITY /FIXED EFFECTS=Group USE_INTERCEPT=TRUE /EMMEANS TABLES=Group COMPARE=Group CONTRAST=DEVIATION. Ryan On Tue, Nov 16, 2010 at 10:43 PM, R B <[hidden email]> wrote: > Joost, > > I assume you want to compare each of the group means to the grand > mean. Am I right? If yes, take a look at the example I provide below. > This is the first time I've done this, so I'm not certain it is > correct. I think this approach should work. I'll write back if I come > up with evidence that suggests otherwise. > > Ryan > > -- > > data list list / ID Group Y. > begin data > 1 1 24 > 2 1 22 > 3 1 21 > 4 1 23 > 5 2 67 > 6 2 66 > 7 2 67 > 8 2 65 > 9 3 43 > 10 3 44 > 11 3 45 > 12 3 42 > 13 4 12 > 14 4 11 > 15 4 10 > 16 4 13 > end data. > > MIXED Y BY Group > /FIXED= Group | SSTYPE(3) > /METHOD=REML > /PRINT= SOLUTION DESCRIPTIVES > /TEST ='Grand Versus Group 1' Intercept 0 Group -12 4 4 4 Divisor=16 > /TEST ='Grand Versus Group 2' Intercept 0 Group 4 -12 4 4 Divisor=16 > /TEST ='Grand Versus Group 3' Intercept 0 Group 4 4 -12 4 Divisor=16 > /TEST ='Grand Versus Group 4' Intercept 0 Group 4 4 4 -12 Divisor=16. > > On Tue, Nov 16, 2010 at 8:28 AM, Ginkel, Joost van > <[hidden email]> wrote: >> >> Dear Alex, >> >> Thanks for your reply. I'll see if the TEST option works. >> >> Best regards, >> >> Joost van Ginkel >> >> >> Joost R. van Ginkel, PhD >> Leiden University >> Faculty of Social and Behavioural Sciences >> PO Box 9555 >> 2300 RB Leiden >> The Netherlands >> Tel: +31-(0)71-527 3620 >> Fax: +31-(0)71-527 3945 >> >> >> ________________________________ >> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Alex Reutter >> Sent: Monday, November 15, 2010 5:42 PM >> To: [hidden email] >> Subject: Re: Effect coding in mixed models >> >> >> There is no way to request effect coding during estimation of the mixed model; you would need to recode the variable(s) prior to running MIXED and pass it the recoded variables. Note that if your aim in using something other than dummy coding is to obtain some specific test of contrasts between levels of a categorical variable, you're probably better off specifying the test you want on the TEST subcommand. >> >> Alex >> >> >> From: "Ginkel, Joost van" <[hidden email]> >> To: [hidden email] >> Date: 11/15/2010 09:59 AM >> Subject: Effect coding in mixed models >> Sent by: "SPSSX(r) Discussion" <[hidden email]> >> ________________________________ >> >> >> Dear list, >> >> I was wondering whether it is possible to use effect coding instead of dummy coding in Mixed models for categorical variables. If so, how can you do this? >> >> Best regards, >> >> Joost van Ginkel >> >> 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 |
Free forum by Nabble | Edit this page |