similar to: fixed effects linear model in R

Displaying 20 results from an estimated 1000 matches similar to: "fixed effects linear model in R"

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
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
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
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
2012 Mar 12
2
Replicating Stata's xtreg clustered SEs in R
I'm trying to replicate a time-series cross-sectional analysis (countries over years) with SEs clustered by country. ?The original analysis was done in Stata 10 with: xtreg [DV] [IVs] fe cluster(country). Using plm() in R (cran.r-project.org/web/packages/plm/index.html), I've replicated the coefficients. I sought to estimate country-clustered SEs with vcovHC(), and tried a variety of
2013 Jan 11
0
Manual two-way demeaning of unbalanced panel data (Wansbeek/Kapteyn transformation)
Dear R users, I wish to manually demean a panel over time and entities. I tried to code the Wansbeek and Kapteyn (1989) transformation (from Baltagi's book Ch. 9). As a benchmark I use both the pmodel.response() and model.matrix() functions in package plm and the results from using dummy variables. As far as I understood the transformation (Ch.3), Q%*%y (with y being the dependent variable)
2007 Nov 24
1
Bug in package stats function ar() (PR#10459)
Full_Name: Steven McKinney Version: 2.6.0 OS: OS X Submission from: (NULL) (142.103.207.10) Function ar() in package "stats" is showing a quirky bug. Some calls to ar() run to completion, others throw an error. The bug is reproducible by several people on different machines, however, the ar() function itself ends up throwing the error sporadically. Several calls to ar() may be
2011 Mar 29
1
Simple AR(2)
Hi there, we are beginners in R and we are trying to fit the following time series using ar(2): > x <- c(1.89, 2.46, 3.23, 3.95, 4.56, 5.07, 5.62, 6.16, 6.26, 6.56, 6.98, > 7.36, 7.53, 7.84, 8.09) The reason of choosing the present time series is that the we have previously calculated analitically the autoregressive coefficients using the direct inversion method as 1.1, 0.765, 0.1173.
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
2010 May 11
5
Regressions with fixed-effect in R
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 variables and run OLS panel regression with function lm(). I plan to do it with the second way because
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
2007 Nov 23
4
help pleaseeeeeeeee
Dears Sirs During my computational work I encountered unexpected behavior when calling "ar" function, namely # time series x<-ts(c(-0.2052083,-0.3764986,-0.3762448,0.3740089,0.2737568,2.8235722,- 1.7783313,0.2728676,-0.3273164),start=c(1978,3),frequency=4,end=c(1980,3)) # ar function res.ar<-ar(x,aic=TRUE,demean=F) # call "ar" again and ............
2004 Jan 22
1
spectrum
Dear R users I have two questions about estimating the spectral power of a time series: 1) I came across a funny thing with the following code: data(co2) par(mfrow=c(2,1)) co2.sp1<-spectrum(co2,detrend=T,demean=T,span=3) co2.sp2<-spectrum(co2[1:468],detrend=T,demean=T,span=3) The first plot displays the frequencies ranging from 0 to 6 whearas the second plot displays the same curve but
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
2006 Nov 13
1
bug in acf (PR#9360)
Full_Name: Ian McLeod Version: 2.3.1 OS: Windows Submission from: (NULL) (129.100.76.136) > There is a simple bug in acf as shown below: > > z <- 1 > acf(z,lag.max=1,plot=FALSE) > Error in acf(z, lag.max = 1, plot = FALSE) : > 'lag.max' must be at least 1 > This is certainly a bug. There are two problems: (i) the error message is wrong since lag.max is
2007 Nov 27
1
help in ar function
Dears Sirs During my computational work I encountered unexpected behaviour when calling "ar" function. I want to select the order p of the autoregressive approximation by AIC criterion and sometimes an error occurs. Example: # time series
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
2005 Nov 28
3
How Can I change the acf's plot type?
In the R Document, the usage of the acf() is as follow: acf(x, lag.max = NULL, type = c("correlation", "covariance", "partial"), plot = TRUE, na.action = na.fail, demean = TRUE, ...) But now I want to get the result picture like: plot(x,type="l") or plot(x,type="p") How can I do this with acf function? 仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭佒伮 伬侎仯仭
2010 May 11
1
Extract model matrix from plm
Is there a way to recover the model matrix that is being used by the plm package? For example, if you run a panel regression with fixed effects, the model matrix would contain the generated dummy variables for the groups. Thanks. Abiel Reinhart This communication is for informational purposes only. I...{{dropped:30}}
2024 Feb 23
2
help - Package: stats - function ar.ols
Hello, Thanks for the reply Rui and for pointing out that I forgot to attach my code. Please find attached in this email my code and data. Thanks in advance. Best regards, Pedro Gerhardt Gavronski. On Fri, Feb 23, 2024 at 5:50?AM Rui Barradas <ruipbarradas at sapo.pt> wrote: > > ?s 16:34 de 22/02/2024, Pedro Gavronski. escreveu: > > Hello, > > > > My name is Pedro