GenLinMixed question

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

Re: GenLinMixed question

Ryan Black
It would be inappropriate to compare nested mixed effects models based on differences in -2 log-likelihood values derived from the GENLINMIXED procedure since, AFAIA, it employs a residual pseudo-likelihood estimation method.
 
Ryan
On Fri, Sep 21, 2012 at 5:20 PM, Bruce Weaver <[hidden email]> wrote:
I agree--it would be GREAT if all of the newer procedures allowed multiple
hierarchical models/steps with one call to the procedure; and for procedures
that use MLE, one should also get a chi-square test on the change in -2LL
from one step to the next (analogous to the F-test on the change in
R-squared that you get from REGRESSION).  As it stands now, you have to do
something like this:  Use OMS to write -2LL values to one new dataset,
number of model parameters to another dataset, merge the 2 datasets, use LAG
to compute changes in -2LL and number of parameters, and then compute the
chi-square & p-values.

Cheers!
Bruce


Alex Reutter wrote
> Hi Bruce,
>
> Yes, that's one of the positives of BY and WITH -- you don't need to
> ensure a consistent case basis prior to running GENLIN or MIXED, but I
> think you do need to prior to running GENLINMIXED.  It would be ideal if
> you could specify the steps within a single call of the procedure, but
> that's not there yet.
>
> Alex
>
>
>
>
> From:   Bruce Weaver <

> bruce.weaver@

> >
> To:

> SPSSX-L@.uga

> ,
> Date:   09/21/2012 03:47 PM
> Subject:        Re: GenLinMixed question
> Sent by:        "SPSSX(r) Discussion" <

> SPSSX-L@.uga

> >
>
>
>
> Hi Alex.  Where one is running a series of models with one or more
> variables
> being added at each step (i.e., what one would call hierarchical
> regression
> in the context of linear regression), one has to ensure that the same
> cases
> are used for all steps.  If you have to run a separate model for each
> step,
> as you do for GENLIN and MIXED, you could lose cases (due to missing data)
> in the later steps.  One way around that is to list ALL of the variables
> that will be in the final model following BY and WITH at each step. Here's
> an example using the cars.sav sample data set.
>
> * Modify path to point to SPSS (English) sample data files.
> GET FILE = "C:\SPSSdata\cars.sav".
>
> freq origin.
> compute USA = (origin EQ 1).
> formats USA(f1).
> crosstabs USA by origin.
> freq cylinder.
> select if any(cylinder,4,6,8).
> freq cylinder.
>
> descriptives mpg horse weight cylinder .
> * For all variables in full model, listwise valid n = 384.
>
> * Model 1: MPG as only predictor.
> * Include only MPG on BY
> <factors>
>  WITH
> <covariates>
>  line.
> GENLIN USA (REFERENCE=FIRST) WITH mpg
>   /MODEL mpg INTERCEPT=YES
>  DISTRIBUTION=BINOMIAL LINK=LOGIT
>   /MISSING CLASSMISSING=EXCLUDE
>   /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).
>
> * Model uses n = 390 cases with valid data for USA and MGP.
> * Now include all FULL MODEL variables on BY
> <factors>
>  WITH
> <covariates>
> line.
>
> GENLIN USA (REFERENCE=FIRST) BY  cylinder (ORDER=ASCENDING) WITH mpg horse
> weight
>   /MODEL mpg INTERCEPT=YES
>  DISTRIBUTION=BINOMIAL LINK=LOGIT
>   /MISSING CLASSMISSING=EXCLUDE
>   /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).
>
> * Model now uses only the n = 384 cases with valid data for all full model
> variables.
>
> * Model 2:  X = MPG HORSE.
> GENLIN USA (REFERENCE=FIRST) BY  cylinder (ORDER=ASCENDING) WITH mpg horse
> weight
>   /MODEL mpg horse INTERCEPT=YES
>  DISTRIBUTION=BINOMIAL LINK=LOGIT
>   /MISSING CLASSMISSING=EXCLUDE
>   /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).
>
> * Model 3:  X = MPG HORSE WEIGHT.
> GENLIN USA (REFERENCE=FIRST) BY  cylinder (ORDER=ASCENDING) WITH mpg horse
> weight
>   /MODEL mpg horse weight INTERCEPT=YES
>  DISTRIBUTION=BINOMIAL LINK=LOGIT
>   /MISSING CLASSMISSING=EXCLUDE
>   /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).
>
> * Model 4:  X = MPG HORSE WEIGHT CYLINDER.
> GENLIN USA (REFERENCE=FIRST) BY  cylinder (ORDER=ASCENDING) WITH mpg horse
> weight
>   /MODEL mpg horse weight cylinder INTERCEPT=YES
>  DISTRIBUTION=BINOMIAL LINK=LOGIT
>   /MISSING CLASSMISSING=EXCLUDE
>   /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).
>
>
> Can GENLINMIXED do that?  Or would one have to first select or flag cases
> that have valid data for all variables included in the final model?  From
> what you've said, I'm guessing the latter.  If so, I'd have to do
> something
> like the following if I was using GENLINMIXED for the example shown above:
>
> * Flag cases that have all variables needed for the full model.
> COMPUTE GoodCase = nmiss(USA,MPG,HORSE,WEIGHT,CYLINDER) EQ 0.
> FILTER BY GoodCase.
> * Series of GENLINMIXED commands here.
> USE ALL.
> FILTER OFF.
>
>
>
>
> Alex Reutter wrote
>> Right, so in GENLIN, you'd have
>>
>> GENLIN target BY
>>
> <factor list>
>>  WITH
>>
> <covariate list>
>>   /MODEL
>>
> <effect list>
>> .
>>
>> and you'd swap time from BY to WITH to treat it as a covariate.  In
>> GENLINMIXED, you'd have
>>
>> GENLINMIXED
>>   /FIELDS TARGET=target
>>   /FIXED EFFECT=
>>
> <effect list>
>> .
>>
>> and you'd add VARIABLE LEVEL time SCALE. before the GENLINMIXED command
> to
>> treat is as a covariate.
>>
>> Having to use VARIABLE LEVEL, I've found I prefer not having to type out
>> all of my variables on BY and WITH, and then again on the MODEL command,
>> especially with a large number of variables, and when I have more than
> one
>> model to run, and I want to run them first with a variable as a factor
> and
>> then as a covariate, it's much easier to put a VARIABLE LEVEL command at
>> the head of a bunch of GENLINMIXED commands than to swap the variable
>> between BY and WITH in each of a bunch of GENLIN commands.
>>
>> Your mileage may vary.
>>
>> Alex
>>
>>
>>
>>
>> From:   Bruce Weaver <
>
>> bruce.weaver@
>
>> >
>> To:
>
>> SPSSX-L@.uga
>
>> ,
>> Date:   09/20/2012 10:19 AM
>> Subject:        Re: GenLinMixed question
>> Sent by:        "SPSSX(r) Discussion" <
>
>> SPSSX-L@.uga
>
>> >
>>
>>
>>
>> I mean that I wish GENLINMIXED *did* use the same BY-WITH method that is
>> used
>> for GENLIN and a host of other older commands.  I've not played with
>> GENLINMIXED yet, but I see that when I do, I'll have to be sure to have
>> the
>> variable levels set appropriately for all of the explanatory variables
>> (something I didn't have to bother with using GENLIN etc).
>>
>>
>>
>> torvon wrote
>>> Bruce,
>>>
>>> Personally, I prefer the old BY categorical WITH continuous variable
>>>> approach.  That way, if someone has neglected to set variable levels,
>>>> they'll still get the right model.
>>>>
>>>
>>> I don't understand what you mean with BY and WITH, since these options
>> are
>>> not available for GENLINMIXED. Are you saying you wish SPSS implemented
>>> that?
>>>
>>> Doesn't say anywhere whether I have to dummy code my categorical
>> variables
>>> for GENLINMIXED or whether SPSS detects the variables correctly.
>> Sometimes
>>> SPSS is so annoying.
>>>
>>> Eiko
>>
>>
>>
>>
>>
>> -----
>> --
>> Bruce Weaver
>
>> bweaver@
>
>> 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://spssx-discussion.1045642.n5.nabble.com/GenLinMixed-question-tp5715073p5715186.html
>
>>
>> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>
>> LISTSERV@.UGA
>
>>  (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
>
>
>
>
>
> -----
> --
> Bruce Weaver

> bweaver@

> 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://spssx-discussion.1045642.n5.nabble.com/GenLinMixed-question-tp5715073p5715227.html
>
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





-----
--
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://spssx-discussion.1045642.n5.nabble.com/GenLinMixed-question-tp5715073p5715229.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

12