This function computes R squared or adjusted R squared for plm objects. It allows to define on which transformation of the data the (adjusted) R squared is to be computed and which method for calculation is used.
r.squared(object, model = NULL, type = c("cor", "rss", "ess"), dfcor = FALSE)
an object of class
on which transformation of the data the R-squared is to be
NULL, the transformation used to estimate the model is
also used for the computation of R squared,
indicates method which is used to compute R squared. One of
"rss" (residual sum of squares),
"ess" (explained sum of
"cor" (coefficient of correlation between the fitted
values and the response),
TRUE, the adjusted R squared is computed.
A numerical value. The R squared or adjusted R squared of the model estimated on the transformed data, e. g. for the within model the so called "within R squared".