plm

estimate a repeated measures random effects model with a nested structure using `plm()`

允我心安 提交于 2020-07-08 20:39:06
问题 Is it possible to estimate a repeated measures random effects model with a nested structure using plm() from the plm package? I know it is possible with lmer() from the lme4 package. However, lmer() rely on a likelihood framework and I am curious to do it with plm() . Here's my minimal working example , inspired by this question. First some required packages and data, # install.packages(c("plm", "lme4", "texreg", "mlmRev"), dependencies = TRUE) data(egsingle, package = "mlmRev") the data-set

estimate a repeated measures random effects model with a nested structure using `plm()`

北战南征 提交于 2020-07-08 20:38:14
问题 Is it possible to estimate a repeated measures random effects model with a nested structure using plm() from the plm package? I know it is possible with lmer() from the lme4 package. However, lmer() rely on a likelihood framework and I am curious to do it with plm() . Here's my minimal working example , inspired by this question. First some required packages and data, # install.packages(c("plm", "lme4", "texreg", "mlmRev"), dependencies = TRUE) data(egsingle, package = "mlmRev") the data-set

estimate a repeated measures random effects model with a nested structure using `plm()`

南楼画角 提交于 2020-07-08 20:38:05
问题 Is it possible to estimate a repeated measures random effects model with a nested structure using plm() from the plm package? I know it is possible with lmer() from the lme4 package. However, lmer() rely on a likelihood framework and I am curious to do it with plm() . Here's my minimal working example , inspired by this question. First some required packages and data, # install.packages(c("plm", "lme4", "texreg", "mlmRev"), dependencies = TRUE) data(egsingle, package = "mlmRev") the data-set

Missing dimensions

懵懂的女人 提交于 2020-06-17 15:53:46
问题 I'm a new R user and I'm trying to use panel data (fixed effects) to analyse the effect that several independent variables have on the log of GNI. I'm using the plm package, and this is my code library(plm) head(project_data) Y = cbind(project_data$log_GNI_PPP) X = cbind(project_data$EU_application, project_data$EU_membership, project_data$distance_from_brussels, project_data$Former_USSR_DUMMY, project_data$natural_resources_pct, project_data$secondary_attendence_prct, project_data$eu

Error when estimating random effects model with plm package when haven is loaded

大城市里の小女人 提交于 2020-05-16 07:40:28
问题 I have a weird problem when estimating a random effects with the plm package in R. Here is a link to a dput of part of my data: https://pastebin.com/raw/mTdh26dg My code is: library(plm) library(haven) pmales <- pdata.frame(males_part, index = c("NR", "YEAR")) random <- plm(WAGE ~ SCHOOL + EXPER + EXPER2 + BLACK + HISP + MAR + UNION + RUR + NE + NC + S + factor(YEAR), data = pmales, model = "random") The reason I included libary(haven) is that my original data set is a .dta file. When I run

Error when estimating random effects model with plm package when haven is loaded

自作多情 提交于 2020-05-16 07:38:45
问题 I have a weird problem when estimating a random effects with the plm package in R. Here is a link to a dput of part of my data: https://pastebin.com/raw/mTdh26dg My code is: library(plm) library(haven) pmales <- pdata.frame(males_part, index = c("NR", "YEAR")) random <- plm(WAGE ~ SCHOOL + EXPER + EXPER2 + BLACK + HISP + MAR + UNION + RUR + NE + NC + S + factor(YEAR), data = pmales, model = "random") The reason I included libary(haven) is that my original data set is a .dta file. When I run

How to get between and overall R2 from plm FE regression?

南笙酒味 提交于 2020-05-16 05:45:25
问题 Is there a way to get plm() to calculate between R2 and overall R2 for me and include them in the summary() output? To clarify what I mean with between, overall, and within R2 see this answer on StackExchange. My understanding is that plm only calculates within R2. I am running a Twoways effects Within Model. A random example (adapted from here): library(plm) # Create some random data set.seed(1) x=rnorm(100); fe=rep(rnorm(10),each=10); id=rep(1:10,each=10); ti=rep(1:10,10); e=rnorm(100) y=x

Error in is.pbalanced.default(x) : argument “y” is missing, with no default, due to stata imported labels

耗尽温柔 提交于 2020-05-16 03:12:11
问题 For the following panel data set: panel <- structure(list(uurwerk = structure(c(40, 40, 40, 40, 36, 1, 32, 36, 32, 32, 36, 36, 40, 40, 40, 40, 40, 38, 38, 38, 38, 60, 55, 40, 42, 42, 42), label = "hours/week work in fact (on average)", class = c("labelled", "numeric")), loon_c = structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), label = "pay/salary [gross] mean int", class = c("labelled", "numeric")), mtr_loon = structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0,

Error in is.pbalanced.default(x) : argument “y” is missing, with no default, due to stata imported labels

生来就可爱ヽ(ⅴ<●) 提交于 2020-05-16 03:12:00
问题 For the following panel data set: panel <- structure(list(uurwerk = structure(c(40, 40, 40, 40, 36, 1, 32, 36, 32, 32, 36, 36, 40, 40, 40, 40, 40, 38, 38, 38, 38, 60, 55, 40, 42, 42, 42), label = "hours/week work in fact (on average)", class = c("labelled", "numeric")), loon_c = structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), label = "pay/salary [gross] mean int", class = c("labelled", "numeric")), mtr_loon = structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0,

R -plm - error within and random effects models (pooling, between & first differences work)

浪子不回头ぞ 提交于 2020-04-18 12:35:28
问题 I have problem with Within and random effect method (it doesn't work). And I have no problem with pooling, between or first diffeences estimator -> it works. I have the same problem like R - Error in class(x) - plm - only within and random effects models. Here is the link to my data: https://www.dropbox.com/s/8tgeyhxeb0wrdri/my_data.xlsx?raw=1 (there are some financial measures and GDP growth for some countries) My code: proba<-read_excel("my_data.xlsx") attach(proba) Y<-cbind(GDP_growth) X<