Displaying 20 results from an estimated 5000 matches similar to: "Extract model matrix from plm"
2010 Apr 30
1
tis: cannot alter subset when input matrix contains NAs
When using the tis time series package (v1.9), I cannot select or alter a subset of a time series when the time series is created from a matrix and the matrix contains NA values.
Example:
x<-tis(t(c(1:10,NA)), start=c(2000,1), freq=12)
x[x>0]<-0
The second line yields "Error in if (any(i > nrow(x))) { : missing value where TRUE/FALSE needed"
However, both of the following
2012 Mar 08
1
Panel models: Fixed effects & random coefficients in plm
Hello,
I am using {plm} to estimate panel models. I want to estimate a model that
includes fixed effects for time and individual, but has a random individual
effect for the coefficient on the independent variable.
That is, I would like to estimate the model:
Y_it = a_i + a_t + B_i * X_it + e_it
Where i denotes individuals, t denotes time, X is my independent variable,
and B (beta) is the
2008 Aug 15
2
Convert text string to object pointer
I would like to use a text string to get a reference to an object whose name
is the text string. I have seen people using get() for this purpose, but as
far as I can tell this returns a copy of the object, not a pointer to the
object. For instance, if I were to write
x <- get("z")
attr(x, "age") <- "fifty"
Then x would have the attribute "age"
2018 Feb 20
1
"Within" model in plm package: is the reported R-squared correct?
Hi everyone,
I am doing panel data analysis using the 'plm' package. However, I have
noticed that the plm() function reports a different value of R-squared from
the R-squared of the lm() function with time-demeaned data. To be clear, I
have tried to compute the within model both manually (run an OLS regression
with time-demeaned data using lm()) and by using plm(). The two methods
give me
2012 Mar 14
1
plm function
Dear Sir/ Madam,
I am writing about the panel data for my bachelor degree.
I would really appreciate if You could help dealing with R functions.
I am trying to estimate the panel data lm model with plm function. When i
include 3dummy variables into the regression it dont appear in the sumarry
of the model, but when i estimate a simple lm model it appears.
Why is it so? What should i do to
2010 May 24
1
Fixed Effects Estimations (in Panel Data)
dear readers---I struggled with how to do nice fixed-effects
regressions in large economic samples for a while. Eventually, I
realized that nlme is not really what I needed (too complex), and all
I really wanted is the plm package. so, I thought I would share a
quick example.
################ sample code to show fixed-effects models? in R
# create a sample panel data set with firms and years
2013 Sep 09
1
theta parameter - plm package
Hi all,
what indicates the parameter theta in the summary of a random effect
panel model estimated with the plm function?
example:
data("Produc", package = "plm")
zz <- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,
model="random", data = Produc, index = c("state","year"))
summary(zz)
Effects:
var std.dev
2011 Sep 05
1
plm package, R squared, dummies in panel data
Hi R-helpers,
I have two questions I hope you could help me with them:
In the plm package how can I calculate the R2 within, R2 between and R2
overall? Is there any special reason to not display these values?
When using first differences do I need to have some special care with
dummies (both year dummies and industry dummies)?
(A friend who works with Stata told me that there is
2010 Feb 04
1
plm issues: error for "within" or "random", but not for "pooling"
Dear all
I am working on unbalanced panel data and I can readily fit a
"pooling" model using plm(), but not a "within" or "random" model.
Reproducing the examples in vignette("plm") and in the AER package I
encountered no such issues.
##unfortunately I cannot disclose the data, and it is too big anyway
> dim(ibes.kld.exp.p[x.subs , ])
[1] 13189 34
2012 Feb 07
1
fixed effects with clustered standard errors
Dear R-helpers,
I have a very simple question and I really hope that someone could help me
I would like to estimate a simple fixed effect regression model with clustered standard errors by individuals.
For those using Stata, the counterpart would be xtreg with the "fe" option, or areg with the "absorb" option and in both case the clustering is achieved with "vce(cluster
2010 Mar 16
2
plm "within" models: is the correct F-statistic reported?
Dear R users
I get different F-statistic results for a "within" model, when using
"time" or "twoways" effects in plm() [1] and when manually specifying
the time control dummies [2].
[1] vignette("plm")
[2] http://cran.r-project.org/doc/contrib/Farnsworth-EconometricsInR.pdf
Two examples below:
library("AER")
data("Grunfeld", package =
2012 Feb 07
1
fixed effects linear model in R
Dear R-helpers,
First of all, sorry for those who have (eventually) already received that request.
The mail has been bumped several times, so I am not sure the list has received it... and I need help (if you have time)! ;-)
I have a very simple question and I really hope that someone could help me
I would like to estimate a simple fixed effect regression model with clustered standard errors by
2012 Mar 20
1
MA process in panels
Dear R users,
I have an unbalanced panel with an average of I=100 individuals and a total
of T=1370 time intervals, i.e. T>>I. So far, I have been using the plm
package.
I wish to estimate a FE model like:
res<-plm(x~c+v, data=pdata_frame, effect="twoways", model="within",
na.action=na.omit)
?where c varies over i and t, and v represents an exogenous impact on x
2008 Jul 23
1
Aggregating zoo object with NAs in multiple column
I would like to run an aggregation on a zoo object that has multiple series
in it, with one of more series having NA values. The problem is that by
default the aggregate function will produce an NA value in each aggregated
period that contains an NA. For instance, if I run aggregate(x,
as.yearmon(index(x)), mean) on the example object "x" which is printed
below, I will just get a bunch
2009 May 08
1
plm: plm.data vs pdata.frame
Hello,
I am trying to use the plm package for panel econometrics. I am just
trying to get started and load my data. It seems from most of the
sample documentation that I need to use the pdata.frame function to
get my data loaded. However, even after installing the "plm" package,
my R installation cannot find the function. I am trying to follow the
example in plmEN.pdf (
2009 Aug 03
1
plm summary error
Dear "plm"-Package insiders,
[I posted the following observation is April already but unfortunately I am not aware of any answers.
With the hope that someone found an answer in the mean time, I ask again:]
I realized the following difficulty with the summary.plm function (demonstrated with the example from the ?plm documentation).
library(plm)
data("Produc",
2009 Apr 25
2
plm Hausman-Taylor model
Dear all-
I am have trouble in using the model="ht" option in function plm from
the plm library. I am using
Package: plm Version: 1.1-1; R version 2.8.1 (2008-12-22) running on a
FC-8 linux machine.
Here is what I am trying to do:
##----------------------------------------------------------------------------
R> ###Prob 6 Chapter 3 Use R! Applied Econometrics with R (Kleiber
2010 Nov 18
1
how do I build panel data/longitudinal data models with AR terms using the plm package or any other package
Hi All,
I am doing econometric modeling of panel data (fixed effects). We currently use Eviews to do this, but I have discovered a bug in Eviews 7 and am exploring the use of R to build panel data models / longitudinal data models. I looked at the plm package but do not see how I can incorporate AR terms in the model using the plm package. I have an Eviews model with two AR terms, AR(1) and
2009 Jul 09
2
plm Issues
Hi List
I'm having difficulty understanding how plm should work with dynamic
formulas. See the commands and output below on a standard data set. Notice
that the first summary(plm(...)) call returns the same result as the second
(it shouldn't if it actually uses the lagged variable requested). The third
call results in error (trying to use diff'ed variable in regression)
Other info:
2012 Apr 26
1
PLM package PGGLS strange behavior
When using the PLM package (version 1.2-8), I encounter the probem that
calling the FGLS estimator evokes strange behavior, when choosing the
"random" effects model. After calling the PGGLS function to estimate FGLS,
PLM gives me a warning, stating that the "random" model has been replaced
with the "pooling" model. I would, however, really like to estimate the
random