Panels and Clustering in R

preview_player
Показать описание
This video runs through an example script on how to estimate panel data models in R using plm(). By appeal to lm() and lmer(), I show that plm() estimates what we think it should estimate. I also show how to cluster standard errors in R. Here are some resources to which I refer in the video:

And some background reading on this.

Рекомендации по теме
Комментарии
Автор

I just updated the details/description of the video to partially answer your question. There are now some slides linked in the details section that describe how to write out the ML and REML likelihood functions. Essentially, REML is a method that focuses on estimating the variance components independently of the main effects (after projecting/modifying the original data accordingly).

intromediateecon
Автор

This is a great post! Are the clustering functions still available online? it seems the metrics.tonycookson.com page does not exist anymore. Many thanks!

theodorcojoianu
Автор

Thank you for posting these helpful videos for R. May ask you a question? What is function of I in lm and plm, e.g. myplm = plm(revenue~I(views/1000), model="within", effect="individual", data=df, index = c("video_id", "day"))?

badasuren
Автор

I got:
Error in UseMethod("vcovHC") :
no applicable method for 'vcovHC' applied to an object of class "c('plm', 'panelmodel')"


When using: coeftest(df2, vcov-pvcovHC(df2, method="arellano", type= "HC3"))
I definitely loaded the and packages though.

RosiePosie
Автор

from which packages can i use the clus_se() function?

ninazwaans
Автор

Could you explain how the REML-method is actially implemented.
I only ever learned the time-demeaning...
How does one specify the restricted likelihood?

Noobwarriking
Автор

Can anyone help me
I getting this message when i'm trying to estimat fixed effect
error in class(x) <- setdiff(class(x), "pseries") : impossible de définir la classe de l'objet comme matrice si son attribut de dimension n'est pas de longueur 2 (il est de 0)

azharbz
Автор

is it possible to add a SE clustering beyond video_id and day? For example, if I have 2 stores, store A, B, C and each have individual video_id, and day, but you can imagine that there are some correlated errors for videos that within the store. so say first 10 videos belong to store A and so on. the traditional LM SE clustering allows for free form clustering, but it seems that PLM only allows clustering for the index used. Maybe i missing a more theoretical understanding of clustering in panel

MrHilbertspaces
Автор

Hello and thanks a lot for the video - it's really helpful.
I am also trying to run a fixed effects panel regression using the plm-function and basically just fitted your code to my data. however I always get the following error:
Error in model.frame.default(formula = y ~ X - 1, drop.unused.levels = TRUE) :
variable lengths differ (found for 'X')

Do you have any idea what my problem might be?

hans-petermeier-schmitt
Автор

Can anyone guide me how to create and object like this NewPSTR(data, dep, indep, indep_k = NULL, tvars, im = 1, iT)

irfanalam
Автор

hi professor where is clustering function at ?

我是正能量
Автор

I wonder what the IDE is the speaker using?

pengxianiu
Автор

sorry make that 3 stores... store A, B, and C

MrHilbertspaces