You would need to transform the time variable into a numeric variable in order to use
polynomials.
Kosuke
Department of Politics
Princeton University
http://imai.princeton.edu
On Jul 20, 2011, at 12:32 AM, Francois Maurice wrote:
Hi,
I'm using ' ls.mixed ' model within Zelig to estimate causal effect of an
intervention in a longitudinal study (one intervention and 8 measures after the
intervention, one per year). I'm not sure to understand how to write the model in
Zelig.
Here's my model in written form :
Level 1 : qasbatij = π0i + π1itimeij + π2itime2ij + π3itime3ij
+ εij
Level 2 : π0i = γ00 + γ01groupi + ζ0i
π 1i = γ10 + ζ1i
π 2i = γ20 + ζ2i
π 3i = γ30
qasbat is a continous outcome, group is the indicator of the treated and control group,
I'm using polynomial time and I let the intercept and the first two polynomials to be
random.
In SAS, I write this model like this :
proc mixed data = p_score_long method=ml noclprint covtest;
class id;
model qasbat = t t2 t3 group / s ddfm=bw notest;
random intercept t t2 / subject=id type=un;
In Zelig, I tried many formats, but Zelig seems to stall (the computing never ends). One
of this format is this :
z.out <- zelig(qasbat ~ group + tag(1 + t + t*t | ID), data=matched.1.mtch.long,
model="ls.mixed")
Within R, the group variable and the ID variable are numeric and the time variable is a
factor.
Merci,
François Maurice
Candidat à la maîtrise
Département de sociologie
Université de Montréal
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/?info=zelig
Zelig program information:
http://gking.harvard.edu/zelig/