Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
218 views
in Technique[技术] by (71.8m points)

r - Why I can't include country dummies in my fixed effects model?

First of all I build the following dataframe (country_Id as factor variable and year as numeric):

mydata = pdata.frame(mydata, index = c("country_Id","year"),row.names = TRUE)

Then I check it with:

index(mydata)  
pdim(mydata)
is.pconsecutive(mydata)
class(mydata)

Everything seems to be fine but I want to include country-dummies in the fixed-effects model it does not work

femodel_1 <- plm(y~x + ldvx + factor(country_Id) , data= mydata, model = "within")

And another problem is that my random model shows that the individual variance is 0

remodel_1 <- plm(y~x + ldvx  , data= mydata, model = "random")

Unfortunately I can not find the problem.

question from:https://stackoverflow.com/questions/66066644/why-i-cant-include-country-dummies-in-my-fixed-effects-model

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...