ssr <- sum(myres^2)/adjssr
tss <- sum(y^2)/adjtss
return(1-ssr/tss)
}
and then
> r2(yourmodel)
Hope this helps
Giovanni
--
Message: 13
Date: Tue, 11 May 2010 13:21:02 +0100
From: Liviu Andronic
To: Daniel Malter
Cc: r-help@r-project.org
Subject: Re: [R] Re
if the plm function only puts out one r-squared, it should be the within
r-squared, but I could be wrong. Stata, for example, gives you a within, a
between, and an overall r-squared. Here is what they do.
set.seed(1)
x=rnorm(100)
fe=rep(rnorm(10),each=10)
id=rep(1:10,each=10)
ti=rep(1:10,10)
e=rn
Thanks. I have the PDF document that you suggest. It is very brief on
fixed-effect in panel regressions.
I will look into plm package.
Best,
Jia
On Tue, May 11, 2010 at 8:19 AM, Liviu Andronic wrote:
> On 5/11/10, chen jia wrote:
>> Are there any functions that specifically deal with fixed-ef
Dear Daniel
On 5/11/10, Daniel Malter wrote:
> R-squared of interest is typically the within R-squared, not the overall or
>
Could you point to an example on how to compute the within R-squared
in R, either via lm() or plm()?
Thank you
Liviu
__
R-help
On 5/11/10, chen jia wrote:
> Are there any functions that specifically deal with fixed-effects?
>
Other than plm and its vignette, you may want to check this document [1].
Liviu
[1] http://cran.r-project.org/doc/contrib/Farnsworth-EconometricsInR.pdf
___
There is the plm package for linear panel models. Further, since estimation
of fixed effects models rests on the within-subject or -object variance, the
R-squared of interest is typically the within R-squared, not the overall or
between R-squared. Read up about it before you use it though.
Daniel
Hi there,
Maybe people who know both R and econometrics will be able to answer
my questions.
I want to run panel regressions in R with fixed-effect. I know two
ways to do it.
First, I can include factor(grouping_variable) in my regression equation.
Second, I plan to subtract group mean from my va
7 matches
Mail list logo