Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Gllamm, random effects and splines

From   "Moran, John (NWAHS)" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   RE: st: Gllamm, random effects and splines
Date   Thu, 26 Aug 2004 13:24:31 +0930

Dear Stas


Thanks for your reply; I agree that the question was not well posed.


However, you did answer my query when you suggested that I "create day^2 variable and add another -eq- statement corresponding to it." This is what I had in mind, but I wished to be a bit more expansive in my ability to detect any "non-linear" trend over time.


What I specifically had in mind was something parallel to the set up in S-Plus NLME where the formula specifying the particular non-linear model (say, a one-compartment model with first order absorption) is by default included in the _random effects_ part of the call. These non-linear models are used often for pharmacokinetic data.



In the patients currently being considered one might expect the fall in creatinine over time _not_ to be linear and I was attempting (within a random effects model in Stata) to identify such a situation.


Any way, thanks for your suggestion



Best wishes






John Moran

Department of  Intensive Care Medicine

The Queen Elizabeth Hospital

28 Woodville Road

Woodville SA 5011


Tel: 61 08 8222 6463

Fax 61 08 8222 6045

E-mail: [email protected]



-----Original Message-----
From: Stas Kolenikov [mailto:[email protected]]
Sent: Thursday, 26 August 2004 3:10 AM
To: [email protected]
Subject: Re: st: Gllamm, random effects and splines


> My question:


> In the absence of the ability to model the "day" correlation structure (for

> example AR1) with the current version of gllamm (correct me if I am wrong

> here), is it possible to model the (random) slopes using, say, a spline and

> if so, what would be the appropriate code (to enable each patient to have

> their own (random) "slope" ("spline")).


I am not quite sure your question is well posed. Splines model the trend,

or the average, or whatever function of that average is implied by the

link function in your generalized linear model. Random effects model the

individual variations.


The model you specified postulates that the effect is linear in time, and

those effects may differ across individuals. If you want, you can have a

more complicated structure, say quadratic over time. With 7 observations

per patient, you won't be able to go anywhere beyond that. And with 36

effective observations, estimating anything by maximum likelihood is a

heroic effort per se; I would personally doubt whether you have enough

variation to even estimate the linear trend reasonably well, unless your

patient show a real quick recovery (I know nothing about insult treatment,

I'd have to admit :)). If you want to introduce the quadratic term, you

would have to create day^2 variable and add another -eq- statement

corresponding to it. See whether the variance of that term is

significantly different from zero, and keep in mind it has a non-standard

distribution. Stata used to have a help file describing it with a

reference to the variance components testing in -xtreg-, but I was not

able to find it anywhere.


 ---                                    Stas Kolenikov

 --       Ph.D. student in Statistics at UNC-Chapel Hill

 -  -- [email protected]


* This e-mail and all attachments to it are not intended to provide any

* reasonable point of view and was transmitted to you in error. It

* should be immediately deleted by all recipients unless they really

* enjoy communicating with the author :). Other restrictions apply.



*   For searches and help try:




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index