from your description I think you need a random-effects model. Since
you assume normality the parameter estimates from a random-effects
model (in your case `GDP.log2') have a marginal interpretation (in
fact they have both conditional and marginal interpretation). Thus,
you could also use lmer() from package `lme4' to fit such a model,
e.g.,
fit1 <- lmer(ineq ~ GDP.log2 + (1 | country), data = data3)
summary(fit1)
# intercept + Emprirical Bayes estimates of
# the random-effect per country
fixef(fit1)[1] + unlist(ranef(fit1))
If you have repeated measurement in time, you could include
random-slopes (e.g., in lmer()) or an AR1 structure, as you did below.
For the latter case, you probably want to use functions lme() and
gls() from package `nlme'.
I hope it helps.
Best,
Dimitris
----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
http://www.student.kuleuven.be/~m0390867/dimitris.htm
----- Original Message -----
From: "Chris Linton" <connect.chris at gmail.com>
To: <r-help at stat.math.ethz.ch>
Sent: Friday, July 20, 2007 9:34 AM
Subject: [R] GEE code
> I'm writing a paper aimed at motivating the use of GEE within the
> field of
> economics. However, after computing using the geeglm function, I
> noticed
> there's one intercept in the summary output. I assume this means
> the
> function is pooling the data. That means my code is not what I
> want. I
> want a "fixed effects" model, meaning I want the intercept to
vary
> by
> cluster. Here's my current code.
>
>
gfit4<-geeglm(ineq~GDP.log2,family=gaussian(link="identity"),data=data3,id=country,corstr="ar1")
> summary(gfit4)
>
>
> What do I need to include to get the function to compute a model
> where the
> intercept varies by the country?
>
>
>
> Thanks
>
> -chris linton
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm